diff options
author | jfbu <jfbu@free.fr> | 2018-01-05 17:06:10 +0300 |
---|---|---|
committer | jfbu <jfbu@free.fr> | 2018-01-05 17:06:10 +0300 |
commit | bd139453c96864646c0b7b1bf2f30b12587cb235 (patch) | |
tree | e6ea6b162505f429411b54a28814f0fb01facc78 /sphinx/parsers.py | |
parent | 4277eb13315d5649401190df86874b3832ddfa3e (diff) |
Move SphinxSmartQuotes transform to SphinxStandaloneReader
closes #4142
closes #4357
closes #4359
refs: #3967
Adds ``smartquotes``, ``smartquotes_action``, ``smartquotes_excludes``
configuration variables.
- if ``smartquotes`` is set to False, then Smart Quotes transform is not
applied even if a Docutils configuration file activates it,
- the current default of ``smartquotes_excludes`` deactivates Smart
Quotes for Japanese language, and also for the ``man`` and ``text``
builders.
However, currently ``make text html`` deactivates Smart Quotes for
``html`` too, and ``make html text`` activates them for ``text`` too,
because the picked environment is shared and already transformed.
- now Smart Quotes get applied also when source documents are in
Markdown or other formats.
Diffstat (limited to 'sphinx/parsers.py')
-rw-r--r-- | sphinx/parsers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/parsers.py b/sphinx/parsers.py index b58eefa23..1aa16a45e 100644 --- a/sphinx/parsers.py +++ b/sphinx/parsers.py @@ -13,8 +13,6 @@ import docutils.parsers import docutils.parsers.rst from docutils.transforms.universal import SmartQuotes -from sphinx.transforms import SphinxSmartQuotes - if False: # For type annotation from typing import Any, Dict, List, Type # NOQA @@ -60,10 +58,11 @@ class RSTParser(docutils.parsers.rst.Parser): def get_transforms(self): # type: () -> List[Type[Transform]] - """Sphinx's reST parser replaces a transform class for smart-quotes by own's""" + """Sphinx's reST parser replaces a transform class for smart-quotes by own's + + refs: sphinx.io.SphinxStandaloneReader""" transforms = docutils.parsers.rst.Parser.get_transforms(self) transforms.remove(SmartQuotes) - transforms.append(SphinxSmartQuotes) return transforms |