From ca6a5b53c92b93684785a9b198bf83dafbd8a610 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 9 Jan 2011 21:37:02 +0100 Subject: [PATCH] =?UTF-8?q?changeset:=203201:2a38261315ba=20tag:=20tip=20p?= =?UTF-8?q?arent:=203199:cd7b0a8d99c6=20user:=20Zbigniew=20J=C4=99drzejews?= =?UTF-8?q?ki-Szmek=20=20date:=20Sun=20Jan=2009=2020:55?= =?UTF-8?q?:13=202011=20+0100=20summary:=20Trim=20=20just=20lik?= =?UTF-8?q?e=20doctest=20flags.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sphinx/highlighting.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index e84238e8a..76bcb122d 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -21,6 +21,7 @@ except ImportError: parser = None from sphinx.util.texescape import tex_hl_escape_map_old, tex_hl_escape_map_new +from sphinx.ext import doctest try: import pygments @@ -64,8 +65,6 @@ _LATEX_STYLES = r''' \newcommand\PYGZrb{]} ''' -doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE) - parsing_exceptions = (SyntaxError, UnicodeEncodeError) if sys.version_info < (2, 5): # Python <= 2.4 raises MemoryError when parsing an @@ -196,7 +195,8 @@ class PygmentsBridge(object): # trim doctest options if wanted if isinstance(lexer, PythonConsoleLexer) and self.trim_doctest_flags: - source = doctestopt_re.sub('', source) + source = doctest.blankline_re.sub('', source) + source = doctest.doctestopt_re.sub('', source) # highlight via Pygments try: