diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 18:49:54 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 18:53:56 +0300 |
commit | 357b1ce2e6d713fb8cfb5644421bf5ded989f32a (patch) | |
tree | b99e16522017a1eccc9f7ad5b353aba790746908 /sphinx/highlighting.py | |
parent | 79eec90f36f5a74e24cfd6740126396fd6567e07 (diff) |
Replace pycompat.htmlescape() by html.escape()
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 40244215f..1ecf3d8d5 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -9,6 +9,7 @@ :license: BSD, see LICENSE for details. """ +import html import warnings from pygments import highlight @@ -27,7 +28,6 @@ from sphinx.ext import doctest from sphinx.locale import __ from sphinx.pygments_styles import SphinxStyle, NoneStyle from sphinx.util import logging -from sphinx.util.pycompat import htmlescape from sphinx.util.texescape import tex_hl_escape_map_new if False: @@ -103,7 +103,7 @@ class PygmentsBridge: warnings.warn('PygmentsBridge.unhighlighted() is now deprecated.', RemovedInSphinx30Warning, stacklevel=2) if self.dest == 'html': - return '<pre>' + htmlescape(source) + '</pre>\n' + return '<pre>' + html.escape(source) + '</pre>\n' else: # first, escape highlighting characters like Pygments does source = source.translate(escape_hl_chars) |