parsedown icon indicating copy to clipboard operation
parsedown copied to clipboard

Unable to handle link markdown [link](text)

Open laukstein opened this issue 6 years ago • 1 comments

Links markdown

[https://domain.com/]("foo bar")

[https://domain.com/](foo bar)

[https://domain.com/](foo)

results

<p>[<a href="https://domain.com/]("foo">https://domain.com/]("foo</a> bar&quot;)</p>
<p>[<a href="https://domain.com/](foo">https://domain.com/](foo</a> bar)</p>
<p><a href="foo"><a href="https://domain.com/">https://domain.com/</a></a></p>

while expected to result

<p><a href="https://domain.com/" title="foo bar">https://domain.com/</a></p>
<p><a href="https://domain.com/" title="foo bar">https://domain.com/</a></p>
<p><a href="https://domain.com/" title="foo">https://domain.com/</a></p>

grabilla q17112

laukstein avatar Mar 26 '19 18:03 laukstein

GitHub renders these like:

<p>[https://domain.com/]("foo bar")</p>
<p>[https://domain.com/](foo bar)</p>
<p><a href="foo">https://domain.com/</a></p>

So I think this is the expected result here. The first two aren't valid links (according to CommonMark), and Parsedown is doing the correct thing in that respect. Although Parsedown is incorrectly inserting autolinks (according to extended autolinks defined in the GFM spec), so I fixed that in c0db218d2275d387a72ae0f1f66b66e22df0c6e0.

Screenshot 2019-03-26 at 21 46 54

aidantwoods avatar Mar 26 '19 21:03 aidantwoods