summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-21 11:25:54 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-21 13:54:51 +0900
commitf3019ee1974fda0722a71c8159ab97c4e78779dd (patch)
tree867421e8dc7ce0a154deb479b378823067ca8147 /sphinx/highlighting.py
parent4f296c5e6789292bbacd0558c2d671fa5025d580 (diff)
downloadsphinx-git-f3019ee1974fda0722a71c8159ab97c4e78779dd.tar.gz
Apply :confval:`trim_doctest_flags` to all builders (cf. text, manpages)
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r--sphinx/highlighting.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index f31ff88cc..b344dc16b 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -68,7 +68,7 @@ class PygmentsBridge(object):
html_formatter = HtmlFormatter
latex_formatter = LatexFormatter
- def __init__(self, dest='html', stylename='sphinx', trim_doctest_flags=False):
+ def __init__(self, dest='html', stylename='sphinx', trim_doctest_flags=None):
# type: (unicode, unicode, bool) -> None
self.dest = dest
if stylename is None or stylename == 'sphinx':
@@ -81,7 +81,6 @@ class PygmentsBridge(object):
stylename)
else:
style = get_style_by_name(stylename)
- self.trim_doctest_flags = trim_doctest_flags
self.formatter_args = {'style': style} # type: Dict[unicode, Any]
if dest == 'html':
self.formatter = self.html_formatter
@@ -89,6 +88,11 @@ class PygmentsBridge(object):
self.formatter = self.latex_formatter
self.formatter_args['commandprefix'] = 'PYG'
+ self.trim_doctest_flags = trim_doctest_flags
+ if trim_doctest_flags is not None:
+ warnings.warn('trim_doctest_flags option for PygmentsBridge is now deprecated.',
+ RemovedInSphinx30Warning)
+
def get_formatter(self, **kwargs):
# type: (Any) -> Formatter
kwargs.update(self.formatter_args) # type: ignore