Repository navigation
Conversation
When `"smartquotes"` is enabled in `myst_enable_extensions`, resolve the 4-item quote sequence from the document's `language_code`, `smart_quotes` (`alt`), and `smartquotes_locales` settings via Docutils' `smartchars.quotes` and `normalize_language_tag` without mutating global Docutils state, falling back to English typographic quotes when unset or unsupported. Fixes executablebooks#806
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
"smartquotes"was enabled inmyst_enable_extensions,create_md_parserenabledmarkdown-it-py'ssmartquotesrule with its hardcoded English quote set (“”‘’). During parsing, ASCII quotes were converted to English curly quotes before Sphinx'sSphinxSmartQuotesor Docutils'SmartQuotestransform ran, ignoring Sphinx'slanguagesetting and Docutils'--language,--smart-quotes, and--smartquote-localessettings.Changes
resolve_smartquotes()anddocument_smartquotes()inmyst_parser.parsers.mditthat resolve the 4-item(open_double, close_double, open_single, close_single)sequence using Docutils'smartchars.quotestable, BCP 47 subtag fallback (normalize_language_tag),smart_quotes="alt"(-x-altquot), andsmartquotes_localesoverrides without mutating global Docutils state, falling back to English typographic quotes when unset or unsupported.quotesoverride increate_md_parser()and passdocument_smartquotes(document)from bothMystParser.parse()(Sphinx) andParser.parse()(standalone Docutils) whenever"smartquotes"is active (including per-file front matter and nested{include}renders).docs/syntax/optional.mdand add unit and integration tests for standalone Docutils and Sphinx builds.Fixes #806