summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-20 01:37:31 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-07-21 01:50:23 +0900
commit0c277f3ff007a464d7769c9561c449428d38dabc (patch)
tree2444a5f99ee65846ddd9f57a30635e28cb405b03
parentf272d6876cb499ac25f779e606593e3459e565b7 (diff)
downloadsphinx-git-0c277f3ff007a464d7769c9561c449428d38dabc.tar.gz
``sphinx.highlighting.PygmentsBridge.unhighlight()`` is deprecated
-rw-r--r--CHANGES1
-rw-r--r--doc/extdev/index.rst5
-rw-r--r--sphinx/highlighting.py5
3 files changed, 11 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index e57a0dad6..e1aa4e5f8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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: