summaryrefslogtreecommitdiff
path: root/sphinx/highlighting.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-12 23:50:48 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-02-12 23:50:48 +0900
commit9702f0ae612c22f74341d66f390d1cd9672cc175 (patch)
tree4fea369b85e3bf91d351f20566684e093678c8d8 /sphinx/highlighting.py
parent5018422db35b5a1d09ac0a2866bc02677079ffdf (diff)
downloadsphinx-git-9702f0ae612c22f74341d66f390d1cd9672cc175.tar.gz
Fix #7139: ``code-block:: guess`` does not work
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r--sphinx/highlighting.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py
index f3445d1bd..4dc9ce543 100644
--- a/sphinx/highlighting.py
+++ b/sphinx/highlighting.py
@@ -105,11 +105,6 @@ class PygmentsBridge:
lang = 'pycon3'
else:
lang = 'python3'
- elif lang == 'guess':
- try:
- lexer = guess_lexer(source)
- except Exception:
- lexer = lexers['none']
if lang in lexers:
# just return custom lexers here (without installing raiseonerror filter)
@@ -119,7 +114,7 @@ class PygmentsBridge:
else:
try:
if lang == 'guess':
- lexer = guess_lexer(lang, **opts)
+ lexer = guess_lexer(source, **opts)
else:
lexer = get_lexer_by_name(lang, **opts)
except ClassNotFound: