Links in parentheses are not hyperlinked

AI-generated summary

The discussion focuses on an issue with links in parentheses not being hyperlinked on the Discourse platform. strager initially noticed this problem while typing a comment. codinghorror tested and confirmed the issue, and sam attributed it to the autolink regex being “nasty” and “broken in quite a few cases.” sam provided a link to the relevant code and identified specific lines of code as part of the problem. rikling and sam further analyzed the code, and mcwumbly and jomaxro shared their own experiences with the issue. As a workaround, jomaxro suggested surrounding the link with < and >. A pull request, https://github.com/discourse/discourse/pull/4523, was submitted to address the issue.

Continuing the discussion from Dealing with unwanted (and probably spam) accounts from other countries?:

I noticed when typing the comment above that links in parentheses are not hyperlinked.

2개의 좋아요

Let’s see

And (http://www.example.com) so yep, you’re right.

The autolink regex is nasty, and broken in quite a few cases

Can you post a link to the exact line of code here and I will look at it?

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

It needs to deal with diff rules for domain part vs path part vs query string

2개의 좋아요

I think this is part of the problem.

is another part of the problem.

Just ran into this… It seems relatively common behavior on our site right now for people to parenthetically include links.

1개의 좋아요

Ran into this as well today. Easy enough to surround the link with <> but annoying nonetheless.

Examples:

Doesn’t work:
(http://www.example.com)
(http://www.example.com)

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

3개의 좋아요

https://github.com/discourse/discourse/pull/4523

5개의 좋아요