Skip to content

Glossary URLs with anchor link no longer jump to definitions #90492

Open

Description

@treyhunner
BPO 46334
Nosy @rhettinger, @JulienPalard, @treyhunner, @AlexWaygood

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:

assignee = None
closed_at = None
created_at = <Date 2022-01-10.17:20:52.535>
labels = ['3.11', 'type-bug', '3.10', 'docs']
title = 'Glossary URLs with anchor link no longer jump to definitions'
updated_at = <Date 2022-01-11.04:50:58.978>
user = 'https://github.com/treyhunner'

bugs.python.org fields:

activity = <Date 2022-01-11.04:50:58.978>
actor = 'ned.deily'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2022-01-10.17:20:52.535>
creator = 'trey'
dependencies = []
files = []
hgrepos = []
issue_num = 46334
keywords = []
message_count = 3.0
messages = ['410234', '410235', '410247']
nosy_count = 5.0
nosy_names = ['rhettinger', 'docs@python', 'mdk', 'trey', 'AlexWaygood']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue46334'
versions = ['Python 3.10', 'Python 3.11']

Activity

  1. treyhunner commented on Jan 10, 2022

    @treyhunner
    MemberAuthor

    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).

  2. added
    docsDocumentation in the Doc dir
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    on Jan 10, 2022
  3. added
    docsDocumentation in the Doc dir
    type-bugAn unexpected behavior, bug, or error
    on Jan 10, 2022
  4. AlexWaygood commented on Jan 10, 2022

    @AlexWaygood
    Member

    Reproduced on safari on my iPad, as well.

  5. treyhunner commented on Jan 10, 2022

    @treyhunner
    MemberAuthor

    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.

  6. transferred this issue fromon Apr 10, 2022
  7. CAM-Gerlach commented on Aug 1, 2022

    @CAM-Gerlach
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10 (EOL)end of life3.11only security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions