Skip to content

Commit f9e18fa

Browse files
xdelaruellethiell
authored andcommitted
doc/sphinx: disable smartquotes
Disable `smartquotes` mechanism (called `html_use_smartypants` in older Sphinx versions) to prevent quotes and dashes to be converted to lang-specific entities. With contribution from @volans- for the Sphinx version test code. Closes #402.
1 parent df4c1d8 commit f9e18fa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc/sphinx/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,14 @@ def setup(app):
140140

141141
# If true, SmartyPants will be used to convert quotes and dashes to
142142
# typographically correct entities.
143-
#html_use_smartypants = True
143+
# Better to disable this to prevent alteration of command-line arguments
144+
# Sphinx <1.6 use `html_use_smartypants` and >=1.6 use `smartquotes`
145+
from sphinx import __version__ as sphinx_version
146+
sphinx_version_parts = [int(i) for i in sphinx_version.split('.')]
147+
if sphinx_version_parts[0] <= 1 and sphinx_version_parts[1] < 6:
148+
html_use_smartypants = False
149+
else:
150+
smartquotes = False
144151

145152
# Custom sidebar templates, maps document names to template names.
146153
#html_sidebars = {}

0 commit comments

Comments
 (0)