Repository navigation
✨ NEW: Add verbatim syntax highlighter output - #488
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Highlighters such as Pygments return a complete HTML block beginning with
<div>, which the current renderer nests inside another<pre><code>wrapper. Add the optional Python-onlyhighlight_verbatimsetting: a nonempty callback result is returned exactly as supplied. Empty results and absent callbacks retain the escaped-code fallback; existing behavior remains the default. Document the option, escaping responsibility and a Pygments example. Fixes #256.Validation: the regression fails against master with extra wrappers/newlines. Tests cover three presets, preserved trailing newlines, the escaped fallback, default wrapping and option toggling. All 1,193 tests passed through tox on Python 3.12; all pre-commit hooks, including Ruff and strict mypy, passed. The strict Sphinx build passed through tox with API generation enabled and the Windows-incompatible post-build
echoomitted.Related earlier proposal: #419 (closed). Prepared with Codex assistance.