diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | doc/extdev/index.rst | 5 | ||||
-rw-r--r-- | sphinx/highlighting.py | 5 |
3 files changed, 11 insertions, 0 deletions
@@ -102,6 +102,7 @@ Deprecated * ``sphinx.ext.mathbase.eqref`` node is deprecated * ``sphinx.ext.mathbase.is_in_section_title()`` is deprecated * ``sphinx.ext.mathbase.MathDomain`` is deprecated +* ``sphinx.highlighting.PygmentsBridge.unhighlight()`` is deprecated For more details, see `deprecation APIs list <http://www.sphinx-doc.org/en/master/extdev/index.html#deprecated-apis>`_ diff --git a/doc/extdev/index.rst b/doc/extdev/index.rst index 7aa6a7948..98824f7ed 100644 --- a/doc/extdev/index.rst +++ b/doc/extdev/index.rst @@ -131,6 +131,11 @@ The following is a list of deprecated interface. - 4.0 - :meth:`~sphinx.application.Sphinx.add_js_file()` + * - ``sphinx.highlighting.PygmentsBridge.unhighlight()`` + - 1.8 + - 3.0 + - N/A + * - ``sphinx.ext.mathbase.MathDomain`` - 1.8 - 3.0 diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index dd248107c..f31ff88cc 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -9,6 +9,8 @@ :license: BSD, see LICENSE for details. """ +import warnings + from pygments import highlight from pygments.filters import ErrorToken from pygments.formatters import HtmlFormatter, LatexFormatter @@ -20,6 +22,7 @@ from pygments.styles import get_style_by_name from pygments.util import ClassNotFound from six import text_type +from sphinx.deprecation import RemovedInSphinx30Warning from sphinx.ext import doctest from sphinx.locale import __ from sphinx.pygments_styles import SphinxStyle, NoneStyle @@ -93,6 +96,8 @@ class PygmentsBridge(object): def unhighlighted(self, source): # type: (unicode) -> unicode + warnings.warn('PygmentsBridge.unhighlighted() is now deprecated.', + RemovedInSphinx30Warning) if self.dest == 'html': return '<pre>' + htmlescape(source) + '</pre>\n' else: |