Some characters after URL mean topic link doesn't work

I think it’s because you can add things like .rss, so if you finish off a sentence in brackets with a link the full stop then Discourse thinks it’s all part of the URL.

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.]:

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.]

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1]:

[Link: New to Discourse? Start here!]

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1?u=jonathan5.]:

[Link: New to Discourse? Start here!]

(Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.):

(Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.)

i don’t understand why you are including periods and exclamation marks as part of the links. and why are you using the square brackets like that? what is the use case you are doing?

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.]

(Sometimes sentences appear within round or square brackets.)

i was probably overthinking what you are trying to do. you are just talking about random use of square brackets i assume. yea they can break stuff occasionally in markdown links.

It’s not entirely a markdown thing, or at least it doesn’t seem to be based on what https://markdownviewer.org/ does. There, .) at the end is not treated as part of the URL though .] is.

Also, rather than “random use of square brackets” it’s the use of a URL at the end of a sentence which is in brackets.

yea welcome to square bracket fun in markdown. there is a reason i never use them unless fenced by code. i guess discourse could escape those?

This is the default behavior of GitHub - markdown-it/linkify-it: Links recognition library with full unicode support · GitHub.

You can test it at linkify-it demo

To explictly choose where the link starts/ends, you can use angle brackets like this:

[Link: <https://meta.discourse.org/t/new-to-discourse-start-here/1>.]

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.]

yea that’s exactly how i did this (i guess i should have given the code tho lol)

Good to know, thanks! Edit: That link works, though it’s not showing the topic title. I’ll stick to omitting the full stop :slight_smile:

That link doesn’t work!

works just fine for me - i think quote removed the angle brackets

[Link: https://meta.discourse.org/t/new-to-discourse-start-here/1.]

Thanks all. Looks as though this is a Markdown thing rather than just Discourse, and there are two potential solutions when a sentence within brackets ends with a URL:

  1. Surround the URL with angle brackets, though this doesn’t display the URL as the topic title, and the link won’t work when quoted.

  2. Just skip the full stop. This is what I’d done before asking here.