hedgedoc / react-client

The frontend of the upcoming version 2.0
https://hedgedoc.dev
GNU Affero General Public License v3.0
104 stars 13 forks source link

.rocks domains do not get auto-linkified #2304

Closed davidmehren closed 2 years ago

davidmehren commented 2 years ago

Which part of the project should be enhanced? The...renderer? auto-linkifier?

Is your enhancement request related to a problem? Please describe. If I add plain links to my Markdown document using TLDs like .de or .com, they automatically are converted into links. The .rocks TLD is not auto-converted:

image

Describe the solution you'd like All links with domains from the public suffix list should be auto-linkified.

Describe alternatives you've considered Keep the current system that provides a confusing user-experience.

Additional context

mrdrogdrog commented 2 years ago

Markdown-it uses linkify-it for link detection. This has a function .tlds() which allows to set custom tlds.

If you don't do this then linkify falls back to a built in list. image

However. Markdown it doesn't offer a possibility to configure its linkify-it instance.

mrdrogdrog commented 2 years ago

So we need to live with it and tell people to use the markdown link syntax or create our own linkify-plugin.

DerMolly commented 2 years ago

We could also open an issue / PR with markdown-it enabling the configuration of linkify-it.

mrdrogdrog commented 2 years ago

Remove my last sentence. Reading docs helps. image

https://markdown-it.github.io/markdown-it/

So. It's possible if we import tlds and stuff that into linkify after the creation of the markdown-it-instance.