diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-12 23:50:48 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-12 23:50:48 +0900 |
commit | 9702f0ae612c22f74341d66f390d1cd9672cc175 (patch) | |
tree | 4fea369b85e3bf91d351f20566684e093678c8d8 | |
parent | 5018422db35b5a1d09ac0a2866bc02677079ffdf (diff) | |
download | sphinx-git-9702f0ae612c22f74341d66f390d1cd9672cc175.tar.gz |
Fix #7139: ``code-block:: guess`` does not work
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/highlighting.py | 7 |
2 files changed, 2 insertions, 6 deletions
@@ -60,6 +60,7 @@ Bugs fixed generated automatically in signatures. * #5637: autodoc: Incorrect handling of nested class names on show-inheritance * #5637: inheritance_diagram: Incorrect handling of nested class names +* #7139: ``code-block:: guess`` does not work Testing -------- 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: |