parsedown
parsedown copied to clipboard
Unable to handle link markdown [link](text)
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")</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>

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.