Skip to content

Commit

Permalink
Fix for sphinx-doc#9291
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoinn committed Jun 4, 2021
1 parent df71e62 commit 732a7d6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions sphinx/ext/intersphinx.py
Expand Up @@ -305,9 +305,19 @@ def missing_reference(app: Sphinx, env: BuildEnvironment, node: pending_xref,
to_try.append((inventories.named_inventory[setname], full_qualified_name))
for inventory, target in to_try:
for objtype in objtypes:
if objtype not in inventory or target not in inventory[objtype]:
continue
proj, version, uri, dispname = inventory[objtype][target]
# Special case handling for term to search in a case insensitive fashion
if objtype == 'std:term' and objtype in inventory:
cased_keys = {k.lower(): k for k in inventory[objtype].keys()}
if target.lower() in cased_keys:
corrected_target = cased_keys[target.lower()]
proj, version, uri, dispname = inventory[objtype][corrected_target]
else:
continue
else:
# Default behaviour pre-patch
if objtype not in inventory or target not in inventory[objtype]:
continue
proj, version, uri, dispname = inventory[objtype][target]
if '://' not in uri and node.get('refdoc'):
# get correct path in case of subdirectories
uri = path.join(relative_path(node['refdoc'], '.'), uri)
Expand Down

0 comments on commit 732a7d6

Please sign in to comment.