summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-02-17 00:46:54 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-02-17 01:07:18 +0900
commit423bf7b5e3ab744ea32b8c929a81a4e6a11db95a (patch)
tree5db680e4a7a39fcb521e965c39a9e9733ce45c97 /sphinx/highlighting.py
parent881e086e506d029cc62619ceeabea845cbb1855f (diff)
downloadsphinx-git-423bf7b5e3ab744ea32b8c929a81a4e6a11db95a.tar.gz
Fix code-block literals raises highlighting warnings by default
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r--sphinx/highlighting.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index 37efdc887..40c83260e 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -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':