mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix code-block literals raises highlighting warnings by default
This commit is contained in:
parent
881e086e50
commit
423bf7b5e3
1
CHANGES
1
CHANGES
@ -12,6 +12,7 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
* Remove ``image/gif`` from supported_image_types of LaTeX writer (#2272)
|
||||
* Fix code-block literals raises highlighting warnings by default
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
@ -144,17 +144,17 @@ class PygmentsBridge(object):
|
||||
if source.startswith('>>>'):
|
||||
# interactive session
|
||||
lexer = lexers['pycon']
|
||||
elif not force:
|
||||
# maybe Python -- try parsing it
|
||||
if self.try_parse(source):
|
||||
lexer = lexers['python']
|
||||
else:
|
||||
lexer = lexers['none']
|
||||
else:
|
||||
lexer = lexers['python']
|
||||
elif lang in ('py3', 'python3'):
|
||||
if source.startswith('>>>'):
|
||||
lexer = lexers['pycon3']
|
||||
elif not force:
|
||||
# maybe Python -- try parsing it
|
||||
if self.try_parse(source):
|
||||
lexer = lexers['python3']
|
||||
else:
|
||||
lexer = lexers['none']
|
||||
else:
|
||||
lexer = lexers['python3']
|
||||
elif lang == 'guess':
|
||||
|
@ -81,8 +81,8 @@ HTML_XPATH = {
|
||||
(".//pre", u'Max Strauß'),
|
||||
(".//a[@href='_downloads/img.png']", ''),
|
||||
(".//a[@href='_downloads/img1.png']", ''),
|
||||
(".//pre", u'"quotes"'),
|
||||
(".//pre", u"'included'"),
|
||||
(".//pre/span", u'"quotes"'),
|
||||
(".//pre/span", u"'included'"),
|
||||
(".//pre/span[@class='s2']", u'üöä'),
|
||||
(".//div[@class='inc-pyobj1 highlight-text']//pre",
|
||||
r'^class Foo:\n pass\n\s*$'),
|
||||
|
Loading…
Reference in New Issue
Block a user