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.