-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot add matrix links as 'discussion channels' #1928
Comments
Ruby's I tried parsing that URL with various other libraries in different languages: Python 3's urllib, Firefox's JavaScript implementation, and the I spent a bit of time reading the spec, and unfortunately it seems to be a case of everyone else being wrong. According to https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 a * Actually even it seems to not agree with itself, it will not escape the 3.1.4 :037 > u = URI.parse("https://matrix.to/")
=> #<URI::HTTPS https://matrix.to/>
3.1.4 :038 > u.fragment = "/#Galaxy-Training-Network_Lobby:gitter.im"
=> "/#Galaxy-Training-Network_Lobby:gitter.im"
3.1.4 :039 > u
=> #<URI::HTTPS https://matrix.to/#/#Galaxy-Training-Network_Lobby:gitter.im>
3.1.4 :040 > u.to_s
=> "https://matrix.to/#/#Galaxy-Training-Network_Lobby:gitter.im"
3.1.4 :041 > URI.parse(u.to_s)
/home/finn/.rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/uri/rfc3986_parser.rb:66:in `split': bad URI(is not URI?): "https://matrix.to/#/#Galaxy-Training-Network_Lobby:gitter.im" (URI::InvalidURIError) |
That would explain why it gets improperly highlighted in so many places (even in their own client), if the second |
Is that a common URL pattern for matrix channels? It may be something we need to support regardless... |
To my knowledge that pattern is common to all matrix servers, but I could be wrong. There are two ways to specify matrix rooms actually https://app.element.io/#/room/!:matrix.org is also used occasionally. |
Interesting! I looked up the "WHATWG URL Standard" and this is what it says about fragment encoding:
I'll see if we can use a more modern URL validator |
Describe the bug
Matrix URLs (which are admittedly a bit strange with two
#
) are considered invalid.To Reproduce
Steps to reproduce the behavior:
https://matrix.to/#/#Galaxy-Training-Network_Lobby:gitter.im
and textMatrix
Expected behavior
It should save
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: