Relax Pygments parsing on lexing failures

This commit is contained in:
Adam Turner
2023-08-12 06:27:16 +01:00
parent 7e9a2066c2
commit 7d8df06e19
3 changed files with 18 additions and 11 deletions

View File

@@ -97,8 +97,8 @@ def test_default_highlight(logger):
# python: raises error if highlighting failed
ret = bridge.highlight_block('reST ``like`` text', 'python')
logger.warning.assert_called_with('Could not lex literal_block %r as "%s". '
'Highlighting skipped.',
'reST ``like`` text', 'python',
logger.warning.assert_called_with('Lexing literal_block %r as "%s" resulted in an error at token: %r. '
'Retrying in relaxed mode.',
'reST ``like`` text', 'python', '`',
type='misc', subtype='highlighting_failure',
location=None)