Skip to content

🐛 FIX: Render implicit glossary links as plain text - #1240

Open
sogav21 wants to merge 1 commit into
executablebooks:masterfrom
sogav21:fix/984-plain-glossary-links
Open

sogav21 wants to merge 1 commit into
executablebooks:masterfrom
sogav21:fix/984-plain-glossary-links

Conversation

@sogav21

@sogav21 sogav21 commented Nov 19, 2026

Copy link
Copy Markdown

Fixes #984.

An empty-label Markdown link such as [](<#example term>) now displays its glossary term as plain text, like the {term} role. Previously a successful glossary lookup left the caption empty, causing the generic reference fallback to render it as code. Explicit labels, including authored inline code, keep their formatting.

Verification

  • Both new regression cases fail on upstream and pass with the fix in Sphinx 8 and 9.
  • tox -e py311-sphinx8,py311-sphinx9 -- -q passed with 1,553 tests on Sphinx 8.2.3 and 1,561 on Sphinx 9.0.4.
  • Real sphinx-build -W HTML builds on both versions confirm that all links retain the same glossary anchor and authored code stays marked as code.
  • pre-commit run --all-files passed.

OpenAI Codex assisted with the diagnosis, code and tests.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Term references shouldn’t show as a code span

1 participant