mdit-py-plugins icon indicating copy to clipboard operation
mdit-py-plugins copied to clipboard

Dollarmath math blocks inside blockquotes retains ">" in the equation.

Open livinNector opened this issue 7 months ago • 1 comments

Describe the bug

context

When rendering dollar math blocks inside block quotes, such as the example below.

> Given
>
> $$
> x^2 + y^2 = 9
> $$
>
> What is the radius of the circle?

bug

The ">" symbol is retained in the rendered equation as shown below.

<blockquote>
<p>Given</p>
<div class="math block">
&gt; x^2 + y^2 = 9
&gt;
</div>
<p>What is the radius of the circle?</p>
</blockquote>

expectation

The math block should not contain ">" (>) inside the equation.

<blockquote>
<p>Given</p>
<div class="math block">
x^2 + y^2 = 9
</div>
<p>What is the radius of the circle?</p>
</blockquote>

Reproduce the bug

  1. Using md.render with dollar math extension will reproduce this issue.

List your environment

No response

livinNector avatar Jun 18 '25 06:06 livinNector

@livinNector If you only use a single blockquote symbol before the dollarmath block symbol, it produces your expected result.

Input:

> Given
>
> $$
x^2 + y^2 = 9
$$
>
> What is the radius of the circle?

Output:

<blockquote>
<p>Given</p>
<div class="math block">
x^2 + y^2 = 9
</div>
<p>What is the radius of the circle?</p>
</blockquote>

e13h avatar Aug 14 '25 21:08 e13h