Option to skip adding <pre><code>
to highlighted code
#256
Labels
enhancement
New feature or request
<pre><code>
to highlighted code
#256
Context
When using the
highlight
option to provide a custom syntax highlighter, markdown-it-py wraps the HTML output of the highlighter in<pre><code>
unless it already starts with<pre
:markdown-it-py/markdown_it/renderer.py
Line 270 in 73a0147
But that heuristic fails for
pygments.highlight
, whose output does not begin with<pre
:So markdown-it-py turns this into
<pre><code><div class="highlight"><pre>…</pre></div></code></pre>
, and existing CSS themes for Pygments need to be rewritten to account for the unnecessarily duplicated<pre>
.Proposal
Can we have an option to skip adding
<pre><code>
that’s not subject to the heuristic?Tasks and updates
No response
The text was updated successfully, but these errors were encountered: