rjeschke / txtmark

Yet another markdown processor for the JVM
Apache License 2.0
449 stars 100 forks source link

Link references should not be processed inside HTML elements #13

Closed davidpeterson closed 9 years ago

davidpeterson commented 11 years ago

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!

davidpeterson commented 11 years ago

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

rjeschke commented 9 years ago

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'.