URL auto-linking doesn't hyperlink if open paren precedes the protocol

markdown-it-review

(Dan Dascalescu) #1

Input:

The Discourse forum (http://discourse.org) rocks.

Expected output:

The Discourse forum (http://discourse.org) rocks.

Actual output:

The Discourse forum (http://discourse.org) rocks.


(Jeff Atwood) #2

Bug? LOL, nope.

http://johnmacfarlane.net/babelmark2/?normalize=1&text=What+(http%3A%2F%2Fexample.com)+Happens%3F

Depends if you believe the Minority Report.


(Sam Saffron) #3

Markdown it linkify handles this fine: https://markdown-it.github.io/

We will be moving to it


(Dan Dascalescu) #4

StackOverflow’s markdown parser does hyperlink (http://example.com).

FWIW, I looked into the best libraries for the job in Feb '14:


(Sam Saffron) #5

Im telling the regex there is hellish, we are just gonna have to wait on the Markdown move it solves this.

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/dialects/autolink_dialect.js#L6


(Sam Saffron) #6

And … (GitHub - markdown-it/markdown-it: Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed) really does rock :drum:

Working now!


(Sam Saffron) #7