russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.45k stars 601 forks source link

Reference-Style Link Followed by Paren Confuses BlackFriday #455

Open theory opened 6 years ago

theory commented 6 years ago

Given this file:


First we have [this link] (and also [that link]), get it?

[this link]: /this
[that link]: /that

Blackfriday outputs:

<p>First we have <a href="and also [that link]">this link</a>, get it?</p>

It looks like the parentheses confuse Blackfriday. For reference, here's how Markdown.pl outputs it:

<p>First we have <a href="/this">this link</a> (and also <a href="/that">that link</a>), get it?</p>

This is the expected output.

theory commented 6 years ago

Note that even if I remove the space before the opening (, Markdown.pl does the right thing:

<p>First we have <a href="/this">this link</a>(and also <a href="/that">that link</a>), get it?</p>
waddles commented 6 years ago

Your syntax is wrong. Try

First we have [this link][] (and also [that link][]), get it?

[this link]: /this
[that link]: /that
theory commented 6 years ago

Sure, there's a workaround, but if the other parsers can figure it out, maybe blackfriday can, too.