Hi maintainers
I have recently found a combination of raw HTML tag + Markdown (with fenced-code-blocks enabled) that I believed renders incorrectly.
Here is small test case that demonstrates the behavior.
Given the following markdown.md file:
<div class="enclosing">
```python
x = 1
```
</div>
and the following command
python lib/markdown2.py --extras fenced-code-blocks markdown.md
The following HTML is rendered:
<div class="enclosing">
<div class="codehilite">
<pre><span></span><code><span class="n">x</span> <span class="o">=</span> <span class="mi">1</span>
</code></pre>
</div>
<p></div></p>
Here, the final enclosing <div> becomes a part of a new <p> pair, leaving the outermost <div> with class "enclosing" unclosed.
The behavior I expected is to render this HTML:
<div class="enclosing">
<div class="codehilite">
<pre><span></span><code><span class="n">x</span> <span class="o">=</span> <span class="mi">1</span>
</code></pre>
</div>
</div>
In fact, this was actually the case up to version 2.4.3. I have not done a fully exhaustive search, but #462 seems to have introduced this behavior.
As additional info, I tested this with CPython 3.10.4, on a8bc182 using Pygments 2.13.0.
If no one has looked into this yet, I'd be happy to take a deeper dive and submit a PR 🙂.
Hi maintainers
I have recently found a combination of raw HTML tag + Markdown (with
fenced-code-blocksenabled) that I believed renders incorrectly.Here is small test case that demonstrates the behavior.
Given the following
markdown.mdfile:and the following command
The following HTML is rendered:
Here, the final enclosing
<div>becomes a part of a new<p>pair, leaving the outermost<div>with class"enclosing"unclosed.The behavior I expected is to render this HTML:
In fact, this was actually the case up to version 2.4.3. I have not done a fully exhaustive search, but #462 seems to have introduced this behavior.
As additional info, I tested this with CPython 3.10.4, on a8bc182 using Pygments 2.13.0.
If no one has looked into this yet, I'd be happy to take a deeper dive and submit a PR 🙂.