-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Escaping double hyphen within :ref: role doesn't work and a dash is rendered. #11492
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
TL;DR: It seems that this works: :ref:`\\\\-\\\\-interface <label>` Because there is some unescape procedure at some point that gobbles one more level of escape. More precisely, if you look at \x00\\x00\-\x00\\x00\-interface and removes the NUL bytes from before <paragraph>
<pending_xref refdoc="index" refdomain="std" refexplicit="True" reftarget="label" reftype="ref" refwarn="True">
<inline classes="xref std std-ref">
\\-\\-interface Then (it's done finished yet!), you apply AFAICT, this transformation finds all In particular, when you process the <paragraph>
<pending_xref refdoc="index" refdomain="std" refexplicit="True" reftarget="label" reftype="ref" refwarn="True">
<inline classes="xref std std-ref">
\-\-interface Then, you process the <paragraph>
<pending_xref refdoc="index" refdomain="std" refexplicit="True" reftarget="label" reftype="ref" refwarn="True">
<inline classes="xref std std-ref">
--interface If you only have one level of escape, processing I don't know if it is a flaw in the design of the I think this logic should only apply to explicit titles. Currently, the explicit titles are unescaped, but I think we may simply keep them as they are. Unescaping them mean removing NUL bytes (which are coming from an escaping backslash in general sphinx/sphinx/util/docutils.py Line 532 in 24b4d65
into |
The |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
The role
should be rendered as
--interface
(with two hyphens) but it is rendered as–interface
(with one en-dash) instead.Outside a
:ref:
the escaping works as expected.These following funky alternatives
don't work either.
The only workaround I've found has been to define
smartquotes = False
inconf.py
.(Since other roles like
:code:
handle--
in a different way, I'm inclined to think that this is a Sphinx and not a Docutils problem, but I may very well be wrong.)How to Reproduce
index.rst
:Run
make html
(ignore undefined label warning).Visit
index.html
.See
–interface –interface –interface –interface –interface
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: