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

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.

3 Likes

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.

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

We will be moving to it

4 Likes

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

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

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

1 Like

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

Working now!

2 Likes