diff options
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 8 |
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 |