Don't override the smart_quotes setting if it was already set

This is needed to fix: https://github.com/sphinx-contrib/spelling/issues/1
This commit is contained in:
Alex Gaynor 2017-10-03 20:59:44 -04:00 committed by Alex Gaynor
parent 50640b700b
commit ee52c7cd4f

View File

@ -676,19 +676,20 @@ class BuildEnvironment(object):
language = self.config.language or 'en' language = self.config.language or 'en'
self.settings['language_code'] = language self.settings['language_code'] = language
self.settings['smart_quotes'] = True if 'smart_quotes' not in self.settings:
if self.config.html_use_smartypants is not None: self.settings['smart_quotes'] = True
warnings.warn("html_use_smartypants option is deprecated. Smart " if self.config.html_use_smartypants is not None:
"quotes are on by default; if you want to disable " warnings.warn("html_use_smartypants option is deprecated. Smart "
"or customize them, use the smart_quotes option in " "quotes are on by default; if you want to disable "
"docutils.conf.", "or customize them, use the smart_quotes option in "
RemovedInSphinx17Warning) "docutils.conf.",
self.settings['smart_quotes'] = self.config.html_use_smartypants RemovedInSphinx17Warning)
for tag in normalize_language_tag(language): self.settings['smart_quotes'] = self.config.html_use_smartypants
if tag in smartchars.quotes: for tag in normalize_language_tag(language):
break if tag in smartchars.quotes:
else: break
self.settings['smart_quotes'] = False else:
self.settings['smart_quotes'] = False
docutilsconf = path.join(self.srcdir, 'docutils.conf') docutilsconf = path.join(self.srcdir, 'docutils.conf')
# read docutils.conf from source dir, not from current dir # read docutils.conf from source dir, not from current dir