Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow case-insensitive match of :term: references through intersphinx #9299

Merged
merged 2 commits into from Jul 11, 2021

Conversation

tomoinn
Copy link
Contributor

@tomoinn tomoinn commented Jun 4, 2021

Subject: Allow case-insensitive match of :term: references through intersphinx

Feature or Bugfix

  • Bugfix

Purpose

  • :term: referenced via intersphinx is case sensitive #9291 describes a problem where term references are resolved in a case insensitive fashion when matching a locally defined glossary, but when that same glossary is accessed through intersphinx this stops working and the term can only be matched with exact case. I'm not particularly familiar with the architecture of sphinx so I might well have put this in the wrong place, but it does fix this issue.

Detail

Simple code change, detects that the objtype is std:term, builds a dict of lower case to original case for all keys in the inventory under inspection and uses that to perform case insensitive matching.

Relates

sphinx/ext/intersphinx.py Outdated Show resolved Hide resolved
Only looks for case insensitive match if there isn't a case sensitive one, and uses filter to build a list of case insensitive matches rather than building a dict.
@tk0miya
Copy link
Member

tk0miya commented Jun 6, 2021

LGTM! Could you add a testcase for this, please?

@tk0miya tk0miya added this to the 4.1.0 milestone Jun 6, 2021
@tk0miya tk0miya changed the title Fix for sphinx-doc/sphinx#9291 Allow case-insensitive match of :term: references through intersphinx Jun 13, 2021
@tomoinn
Copy link
Contributor Author

tomoinn commented Jun 17, 2021

I haven't abandoned this - been busy with the project that needs the fix, will add test cases when I have some time available.

@tk0miya tk0miya merged commit 676983e into sphinx-doc:4.x Jul 11, 2021
@tk0miya
Copy link
Member

tk0miya commented Jul 11, 2021

Now I added a testcase for this and merged. Thank you for your contribution!

Copy link

@GonzaloT23 GonzaloT23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants