rjeschke/txtmark

Link references should not be processed inside HTML elements

davidpeterson opened this issue · 2 comments

Link references are being processed in the wrong place. The following Markdown:

## Example

<pre>
[1]: blah
</pre>

Is converted into this:

<h2>Example</h2>
<pre>
</pre>

When it should be:

<h2>Example</h2>
<pre>
[1]: blah
</pre>

This may explain why your Markdown parser is faster than others!

A workround for authors is to use &#91; instead of [.

This is not really the reason why txtmark is that much faster :D

But, yes, I do not perform real HTML tree parsing. Also, using the <pre> tag when there's built-in markdown functionality to achieve this is kinda the wrong use case.

If there's really, really the need to support and sanitize <pre> tags, I may add this a an optional feature, closing this for now as 'out-of-scope'.