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
Smart quotes get applied to highlighted inline code expressions #9564
Labels
Comments
smartquotes_code_role_example.zip as requested by the GitHub ticket template. |
JustinTArthur
changed the title
Smart quotes gets applied to inline highlighted code expressions
Smart quotes gets applied to highlighted inline code expressions
Aug 20, 2021
JustinTArthur
changed the title
Smart quotes gets applied to highlighted inline code expressions
Smart quotes get applied to highlighted inline code expressions
Aug 20, 2021
JustinTArthur
added a commit
to JustinTArthur/sphinx
that referenced
this issue
Aug 20, 2021
JustinTArthur
added a commit
to JustinTArthur/sphinx
that referenced
this issue
Aug 20, 2021
JustinTArthur
added a commit
to JustinTArthur/sphinx
that referenced
this issue
Aug 20, 2021
JustinTArthur
added a commit
to JustinTArthur/sphinx
that referenced
this issue
Aug 20, 2021
JustinTArthur
added a commit
to JustinTArthur/sphinx
that referenced
this issue
Aug 21, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Given some RST that includes text with a
:code:
role and a language option, sphinx will produce HTML with highlighting for that text's code language. However, if that highlighting introduces more than one sub-level of output nodes, we fail to detect that the text is part of a no-smartquotes zone and mangle text that is intended to be presented literally.How to Reproduce
The following RST:
produces HTML like
Notice the right/left single quotes added by Sphinx in ‘bar’. Because the text node is two ancestors away from the document's
code
node instead of one, it isn't detected as protected from smartquotes.Expected behavior
Straight single and double-quote characters in inline code expressions should be left alone, regardless of whether or not a specific language option is applied.
docutils' built-in smartquotes transformer correctly avoids the highlighted quotation marks.
Your project
Small Sphinx 4 project sample attached.
Screenshots
No response
OS
macOS
Python version
3.9
Sphinx version
4.1.2
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: