davidfstr/rdiscount

Links with right parenthesis rendering

Closed this issue · 3 comments

Notably Wikipedia is using ) in urls, which breaks with rdiscount see example:

require "rdiscount"

markdown = RDiscount.new("[wikipedia](https://en.wikipedia.org/wiki/Peter_Eckersley_(computer_scientist))")
puts markdown.to_html

will produce:

<p><a href="https://en.wikipedia.org/wiki/Peter_Eckersley_(computer_scientist">wikipedia</a>)</p>

Which is a broken link.

Is that intended?

Is that intended?

Try checking the behavior of upstream Discount: http://www.pell.portland.or.us/~orc/Code/discount/

I'm guessing this behavior is intended, because it's not straightforward to distinguish a close paren in a URL from a close paren that stops a link. So I'm tentatively resolving as expected behavior.

Just confirmed

$ markdown foo.bar 
<p><a href="https://en.wikipedia.org/wiki/Peter_Eckersley_(computer_scientist">wikipedia</a>)</p>
$ cat foo.bar 
[wikipedia](https://en.wikipedia.org/wiki/Peter_Eckersley_(computer_scientist))

i will report that in the upstream lib

upstream issue for ref: Orc/discount#260