URLs in parenthesis do not turn into links

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.

1 Like

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

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).

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 )

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

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

2 Likes

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 ().

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

1 Like

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.

6 Likes

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

2 Likes

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

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!

2 Likes