Closed Julian closed 2 years ago
Seems pretty reasonable to me.
This behavior is due to docutils
, it doesn't fall back on any other lexer if a given lexer is not found (see http://docutils.sourceforge.net/sandbox/gitpull/setuptools/docutils/utils/code_analyzer.py)
We could fix this in readme_renderer
by attempting to render the document again with the tokennames == 'none'
setting set, but this would cause all code-blocks to render as literal blocks if a single unknown lexer is found.
Personally I think we should just fail here: the user is asking us to highlight with a specific language, and we can't.
Given a lexer that Pygments doesn't know about (a common one being TOML), it'd be great if
readme_renderer
/ PyPI simply rendered the block as fixed-width text without highlighting, and didn't complain / break.GitHub and other places that reST might be being rendered (like within Sphinx) often have additional language support, and so I often will use some additional languages, even though they might not fully render with highlighting in other places.