mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7140 from tk0miya/7139_code_block_guess
Fix #7139: ``code-block:: guess`` does not work
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -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
|
||||
--------
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user