-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Glossary URLs with anchor link no longer jump to definitions #90492
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
Comments
The glossary page allows for anchor links to jump to specific definitions. For example: https://docs.python.org/3.9/glossary.html#term-lbyl will open the glossary page with the web browser showing the LBYL at the top of the page. This no longer works in Python 3.10 and Python 3.11 documentation. https://docs.python.org/3.10/glossary.html#term-lbyl https://docs.python.org/3.11/glossary.html#term-lbyl Opening either of those links in Chrome or Firefox on my machine results in the glossary page being opened without any scrolling (the top of the glossary page is shown rather than the LBYL definition). |
Reproduced on safari on my iPad, as well. |
I just realized those only affects some terms. parameter works: https://docs.python.org/3/glossary.html#term-parameter And LBYL does work but only if LBYL was used: https://docs.python.org/3/glossary.html#term-LBYL The EAFP term does link to #term-LBYL instead of the old #term-lbyl. It looks like the capitalization changed. The search doesn't seem to know that though (the LBYL glossary link at the top is broken): https://docs.python.org/3/search.html?q=lbyl I would vote for changing the link back to lowercase rather than changing the search to link to the new URL. Otherwise links to specific glossary terms scattered around the internet will all link to the top of the glossary page instead. |
The anchors are generated by Sphinx, so unless we implement our own hacks here, that would have to be a Sphinx change; since that was probably from back when they added support for case-sensitive glossary entries several years and 2-3 major versions ago (since 3.9 was built with Sphinx 2.4.4, 3.10 was built with 3.4.3 and 5.x is the current stable branch), so it would break other users who have adapted by now. To note, until Sphinx 3.5.0 and Python 3.11, the glossary anchors weren't copyable (there was no link or icon in the UI), people had to construct them manually, so the backward compatibility breakage is less concerning than it would have been (though still not ideal). The immediate fix on the CPython side would be to have our custom search functionality generate the correct glossary links from 3.10+. From a quick look, the culprit appears to be the .lower() call here, which is what eventually gets used to construct the fragment in the JS on the custom search page template. We'd have to test it, though, and confirm that nothing else relies on it to be case-folded, but that at least should be a straightforward fix. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: