Hmmm, the problem here seems to be that Ruby canāt parse those URLs:
URI.parse("https://riot.im/app/#/room/#safenetwork:matrix.org")
URI::InvalidURIError: bad URI(is not URI?): https://riot.im/app/#/room/#safenetwork:matrix.org
It honestly seems a bit odd to me to have two hashes in a URL like that.
It honestly seems a bit odd to me that I canāt forward our forum population to our Matrix chatroom. Seriously: If Firefox can open those links, Discourse/Ruby should be able to do it as well.
According to this stack overflow answer a fragment is not allowed to contain #, and so Rubyās internal URI processor is correct.
Itās cool that Firefox allows it, but it would be quite a lot of work to audit our codebase and find all the places where we parse URIs and allow for this special case.
Hey, project lead for Matrix here. Yup, weāre aware that itās a bit naughty to put unescaped #'s in URL fragments, but in practice this is the first time in two years weāve seen anyone actually hitting it as a bug! The workaround is of course to escape it properly as %23.
In the interim it might be kind to consider tweaking your parser to be slightly more forgiving on what it accepts however, in accordance with Postelās law.
In other news, I canāt wait for someone to implement a Discourse<->Matrix bridge, rather than clunky hyperlinking between the two!
The problem is that the parser in question is the Ruby Standard Library one.[quote=āara4n, post:9, topic:52640ā]
In other news, I canāt wait for someone to implement a Discourse<->Matrix bridge, rather than clunky hyperlinking between the two!
[/quote]
However, it also commits a slight naughtiness by hoping to produce user links that look like https://matrix.to/@matthew:matrix.org. Technically youāre meant to escape @ symbols in URL paths too. Can someone confirm if Rubyās URL parser chokes on the unescaped @?
for sure. just seems a bit weird that the Ruby parser is being more unforgiving than any other one weāve encountered. Iām pretty sure weāre not the only people out there who cheat on escaping some inoffensive URL characters in order to make their URLs look prettierā¦ I wonder whether the story here is actually that the Ruby parser just needs a greedy matcher when looking for #'s or something.