URLs in parenthesis do not turn into links


(Pierre-Olivier Latour) #1

v1.4.0.beta3 +76

If you enter URLs in parenthesis, they don’t turn into links:

like this (http://www.apple.com)

like this (http://www.apple.com)

I wonder if that’s a regression as I thought this was working maybe 1 or 2 months ago.


(Mittineague) #2

No regression, that’s incorrect syntax
Try like shown here
http://daringfireball.net/projects/markdown/syntax#link


(Pierre-Olivier Latour) #3

Ah, I didn’t think it would be interpreted as the parenthesis of the markdown link syntax, in which case yes, the brackets would be missing.

That’s too bad as surely I’m not going to be the only to want / attempt to naively put a URL in parenthesis (for reference, I am aware of the markdown link syntax which I use, but sometimes I appreciate being able to just paste a URL and having it works as-is).


(Mittineague) #5

A plain URL will become “linkified” but if you want it in parentheses there needs to be spaces
( http://www.google.com )

( http://www.google.com )


(Alan Tan) #6

Hmm I don’t think it is incorrect syntax. See below for the example on Github.


(Mittineague) #7

Maybe so, but there are different “flavors” of MarkDown. (eg. CommonMark :wink:)
Hint: Discourse does not use the same as Github uses


(Alan Tan) #8

Thanks for clarifying :smile: I wonder if the above is intentional though since I don’t see any advantages of not turning URLs into links if you wrap them in ().


(Mittineague) #9

Neither do I, just the way it is I guess. Same thing when they’re in quotation marks
"http://www.youtube.com"

http://www.youtube.com


(Jeff Atwood) #10

You can always provide extra hints, e.g.

(http://example.com)
(http://example.com)

(http://example.com)
(<http://example.com>)

Turning “raw” links into actual links is not part of Markdown proper. In Markdown, typing a raw link does nothing.


(Sam Saffron) #11

Also, our autolinker is one of the more annoying regexes we ship, and it has plenty holes https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/dialects/autolink_dialect.js


(Alan Tan) #12

Hmm is it a feature that we would want to ship with autolink since we don’t classify it as a bug?


(Mittineague) #13

I’ll say. Anytime I see that many “nots” I can’t help but cringe a little

[^`!()\[\]{};:'".,<>?«»“”‘’\s]

and that’s only a small bit of it!