Skip to content
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

Check complete ancestry of text nodes for smartquotes eligibility. #9565

Conversation

JustinTArthur
Copy link
Contributor

@JustinTArthur JustinTArthur commented Aug 20, 2021

Subject: Fix erroneous application of smartquotes to highlighted inline code roles.

Feature or Bugfix

Bugfix

Purpose

To prevent the smartquotes transformer from transforming text meant to be presented literally, such as text found with the :code: role and a language option set.

Detail

  • sphinx's smartquotes transformer already checks text to see if the text's document node is a direct descendent of an element that shouldn't have typographical adjustments. However, it wasn't looking at the full ancestry, so if the text was a sub-sub-element of a document node meant to hint literal presentation, the text ended up having smartquotes' typographical adjustments applied.
  • docutils' own smartquotes transformer does not currently have this problem

Relates

@JustinTArthur JustinTArthur force-pushed the 9564-fix_highlighted_code_role_smartquotes branch 2 times, most recently from dbaff64 to 1762b9b Compare August 20, 2021 09:37
@JustinTArthur JustinTArthur force-pushed the 9564-fix_highlighted_code_role_smartquotes branch from 1762b9b to adcda09 Compare August 21, 2021 05:20
@tk0miya tk0miya added this to the 4.2.0 milestone Aug 29, 2021
@tk0miya
Copy link
Member

tk0miya commented Aug 29, 2021

Absolutely! Thank you for your contribution!

@tk0miya tk0miya merged commit baacc26 into sphinx-doc:4.x Aug 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smart quotes get applied to highlighted inline code expressions
2 participants