Restrict domain name autolinking so M.Sc and B.Sc are not auto linked

Hi :slight_smile:

Is it possible to “unlink” a link via something like an escape-sequence?
Cause: for example the university graduations M.Sc and B.Sc (master/bachelor of science) are automatically linked. I suspect “.sc” is read as the top-level-domain of the Seychelles.
I don’t think that this is a bug: presumably it’s not possible to separate wanted from unwanted links technical in a perfect way.

Hope this ist the right category. Thanks!
Ronja

3 Likes

Put a space before the period, to form example .com?

For some reason, backslash escaping doesn’t work. WTH?!

Bacticks work

`B.Sc`

B.Sc

3 Likes

Thank you!
A lot better, but not perfect: background-line’s a bit grey/font moves?

You could surround it with tags like this: <span>B.Sc</span>
Yay, no more auto-linking for B.Sc :slightly_smiling_face:

6 Likes

@tgxworld I don’t think we should consider single letter domain names valid domains here.

2 Likes

I think x.org would be upset about that…

3 Likes

Per wikipedia

In 1993, the Internet Assigned Numbers Authority (IANA) explicitly reserved all single-letter and single-digit second-level domain names in the top-level domains com, net, and org, and grandfathered those that had already been assigned

The complete list of grandfathered domains from 1993 is i.net, q.com, q.net, x.com, x.org, and z.com

So it is true on the “traditional” TLDs that single letter domains effectively don’t exist outside the 1993 grandfathered list of 6. But it sounds like on the country TLDs it is more like the wild west…

The list of Country code top-level domains which have been identified to allow single-letter domains are : .ac .af .ag .ai .am .asia .biz .bo .by .bz .cm .cn .co .com.ar .com.br .co.at .co.il .co.uk .cr .cz .cx .dj .de .dk .fm .gd .gg .gl .gp .gs .gt .gy .hn .ht .ie. im .io .je .kg .ki .kw .la .lb .lc .ly .md .mg .mk .mp .ms .mW .mx .mu .nF .nz .pe .ph .pk .pl .pn .pr .pw .ro .sh .st .tc .tl .tt .to .tv .travel .ua .ws .vc .vg .vn and .vu

2 Likes

Yeah, ccTLDs are a law unto themselves. Hell yeah national sovereignty!

(Also, to pick a nit with that list, .asia, .biz, .travel, and all those 2LDs aren’t strictly ccTLDs…)

I have a deeper objection here, which is that we shouldn’t be auto-linkifying every single one of the zillions of TLDs, no matter how rare they are @tgxworld – that is much more risky.

I think if you want crazy-town TLD to auto-link, you should learn how to use the link button in the editor, or the markdown link codes.

4 Likes

This is nothing to do with @tgxworld here, this is linkify by markdown it, we have a few edge cases that pop up but nothing compared to previous linkify

Cc @vitaly

I thought @tgxworld added the code that contains an accurate list of all TLDs, per this post?

gem 'mini_suffix'

Sorry if unrelated! I thought they were…

Yeah this is totally unrelated to linkify, that is pretty much a minor ux feature for the link list underneath the first post

2 Likes

A no-win situation. Passing text through a “known atypical domains” matcher feels like it would be unnecessarily costly. Considering that there are ways to linkify text in the UI that relative non-techies should be able to discover and delinkifying non-URLs is unexpected and requires some techiness to fix, I lean towards the not linkifying atypical URL side

https://github.com/markdown-it/linkify-it#api

My personal opinion, fuzzy links should be disabled.

But if you can’t live without fuzzy links - don’t extend TLD-s list to “everything valid”. If you allow all valid TLDs in fuzzy links, you will get a lot of false positives.

4 Likes

I think this is very reasonable feedback.

I am going to put a #pr-welcome here for the community on

  1. A site setting for “markdown_auto_link_tlds”
  2. Sane defaults for English and other locales we support (per local defaults)

linkify.it should not be a link in English out-of-the-box, but it should probably be a link in if you are running in Italian out-of-the-box.

For default install in English I would autolink:

test.edu, test.gov, test.com, test.com.au, test.co, test.co.uk, test.ca. I am not sure if I would do test.sg, test.ph and test.in out-of-the-box despite the English speaking population. I am also unsure about enabling the fancy domains people use like bit.ly and bla.community it just feels like its not to onorous to add the https:// in front.

x.sc and so on should definitely not be on by default for any of our locales even French cause it is high risk of mistakes

5 Likes

Do people really type domains + paths manually? IMHO that’s the only case when fuzzy links could be useful.

If one copy-paste browser url, it’s detected by http(s) prefix and you only need to beautify it (drop protocol, maybe drop www prefix, drop the middle part for very long links)

2 Likes

Really glad to come across this topic.

Misplaced autolinking is a common issue in our community, where people use their smart devices to pick out posts and often leave out spaces after periods. This leads to alot of strange, errant autolinked text that requires editing later by moderators.

We would certainly turn this off if it became an admin setting.

3 Likes

This bugs me enough on a regular basis that I think it is worth fixing it for good:

https://github.com/discourse/discourse/commit/ee0d3f15c1914bd494ebe88a5831d40be88bbcae

Our new default is that com|net|gov is autolinked, and http:// https:// is autolinked.

Apologies .uk and .au but I feel this new default is far saner and now sites have fidelity to expand or contract the behaviour.

Use: enable_markdown_linkify to enable or disable linkification globally.

Use: markdown_linkify_tlds to list TLDs you wish to auto-link if people forgot to add http[s]:// in front.

@codinghorror you happy with this?

8 Likes

Yes but I feel the “top 10” domains by (English? World?) usage should be whitelisted not just those 3.

3 Likes