-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
InterSphinx + DirHTML results in 'index' ref in objects.inv not loading correctly #7095
Comments
Thank you for reporting and good investigation. |
Sadly, |
But is that incompatible with dirhtml's stated objective? |
hmm... you're right. Then, only we can do is 2nd idea: Update regex to. |
Fix #7095: dirhtml: Cross references are broken via intersphinx and :doc:
Fixed by #7102 |
Describe the bug
When loading from an
objects.inv
from a project built with thedirhtml
builder, theindex
ref has an incorrect URL associated with it.To Reproduce
Notice how the first line doesn't have the correct title
pip - Python Package Installer
or URI ``.Expected behavior
The correct URI is associated with the index page (eg.
#
or/
or ``)Your project
pip
Screenshots
N/A
Environment info
(does not matter, see below)
Additional context
My investigation into this bug: pypa/pip#7130
This issue occurs due to:
dirhtml
builder providinguri = ''
for theindex
page\s+
in the regex used during loading of lines in the intersphinxobjects.inv
format.During writing,
InventoryFile.dump
writes a line containing<priority><space><space><heading>
-- notice the two spaces back to back, one on either side of the empty (""
) uri. This extra whitespace is greedily consumed by the regex, since it uses\s+
for matching the whitespace and it does not allow for an empty uri (it uses\S+
for matching uri).AFAICT, there are two changes that can be made to fix this:
/
or#
a good option?\S*
instead of\S+
).1 provides the ability for older-sphinx to read objects.inv from newer-sphinx. 2 provides the ability for newer-sphinx to read objects.inv from older-sphinx. Implementing both would likely be best for interoperability between sphinx versions.
The text was updated successfully, but these errors were encountered: