showdown icon indicating copy to clipboard operation
showdown copied to clipboard

Strange parsing issue with <pre><code>

Open EhsanKia opened this issue 6 years ago • 1 comments

Not sure if this is a parsing bug, could anyone confirm?

Try the follow in http://demo.showdownjs.com/

<pre><code>test1</code></pre>
a<pre><code>test2</code></pre>

And then

<pre><code>test1</code></pre>
a<pre><code>test2
</code></pre>

The latter gets parsed wrong. Is that normal?

EhsanKia avatar Jun 06 '18 00:06 EhsanKia

Yes, this is a limitation of showdown's HTML pre-code block parser, for performance reasons.

I'm not sure if we can "fix" this without hindering performance too much. But I will leave it open and pending for v2.0

tivie avatar Jun 27 '18 20:06 tivie