Issue with the handling of underscore characters in URL querystrings

AI-generated summary

The handling of underscore characters in URL query strings is causing issues on Discourse. merefield reported that links with two separated underscores in the query string are not working properly. Moin suggested using angle brackets <https://www.youtube.com/watch?v=_ps_-I1jgYU> as a workaround. JammyDodger referenced a similar issue and provided another workaround: replacing the underscore with its URL-encoded version (%5F). This solution works, as demonstrated by the link https://youtu.be/%5Fps_-I1jgYU. merefield apologized for not searching for existing reports and appreciated the quick workaround.

The system appears to be trying to italicise the middle of the URL query string?

https://www.youtube.com/watch?v=_ps_-I1jgYU

https://youtu.be/_ps_-I1jgYU

This is an apparently legal URL to YouTube, but Discourse doesn’t like it much, making it impossible to share any links with two separated underscores in the query string?

5 Likes

Reading this topic Links broken with (at least) two underscores in URL
<https://www.youtube.com/watch?v=_ps_-I1jgYU> is a workaround
https://www.youtube.com/watch?v=_ps_-I1jgYU

3 Likes

There was a similar issue in this topic too Links with multiple dots aren’t linking right

The other workaround in the topic @Moin linked should let the link onebox:

https://youtu.be/%5Fps_-I1jgYU

4 Likes

Gah sorry for not using search on this occasion. Feel free to merge with prior reports or delete this Topic.

Appreciate the quick workaround!

4 Likes