sphinx-doc / sphinx-doc/sphinx
Reference to heading with literal is not rendered as literal
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Using a :ref: to a label of a heading that contains a literal is not rendered as a literal (monospaced font)
To Reproduce
Steps to reproduce the behavior:
###
Bla
###
.. _mylabel:
This header has a ``literal``
=============================
This is a reference to the header above :ref:`mylabel`
Produces the following HTML and PDF:
Expected behavior
The word "literal" in the reference to be in a monospaced font (as well as in italics in PDF)
Environment info
- Sphinx version: 1.8.5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided reStructuredText reproduction using the :ref: link and compare its HTML and PDF output. Trace how the heading label is resolved and rendered, then verify that the literal text remains monospaced in HTML and monospaced and italicized in PDF.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100