-
Notifications
You must be signed in to change notification settings - Fork 172
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
Linkified text is too greedy and gobbles punctuation #4208
Comments
Not to be that guy, but parenthesis and punctuation are perfectly valid parts of a well-formed URI as described by RFC3986 While I personally agree with the fact that it's really annoying to type, the RFC also states that:
Take the search query "symbol )" on duckduckgo as an example: |
I don't experience this behaviour in Slack or Teams for Android. You can user-blame all you want, but I don't think that will attract more participants to your platform. Your response makes me a lot less likely to use or recommend Element. |
Auto-linkification is a convenience feature. It doesn't need to follow a spec, it should correctly highlight as many links as possible. From my experience, people commonly place punctuation immediately after a link, and rarely post a link ending in such symbols. |
To be fair, specwise this is a valid URL: https://en.m.wikipedia.org/wiki/Wikipedia_(disambiguation) (and this markdown parser displays it as such). Perhaps, this can be made smart enough so that it checks for open and unclosed parenthesis before the URl, to be safe. This is what WhatsApp does. |
Interesting, MY WhatsApp Android did manage this correctly (see last screenshot above your post). However, I did manage to confuse it in the end In general, I was quite impressed though, how smart it handled these cases. Anyway, up to someone else on how to deal with this mess 😜 |
My comment seems to have caused emotional distress, which is not what I was trying to achieve. Let me re-phrase what I said earlier with less words:
Hope that makes sense. I am not trying to blame "the user", nor do I care whether you use Element or not.
I really like this behavior, although again the URL could be preceded by other text which is also inside the brackets: How about detecting links that have been pasted (if possible) and not adding symbols typed by the user to the link? |
FWIW we're using Google's official linkification solution for Android, so I expected it to handle these cases a bit better, to be honest. We can try looking for alternative solutions, since there may be some as performant and more correct. |
Steps to reproduce
Outcome
What did you expect?
Punctuation at the end of a URl shouldn't be included in that URl.
What happened instead?
The link goes to a 404.
I suspect this is related to this Android bug - https://issuetracker.google.com/issues/161727315
Your phone model
Google Pixel 8Pro
Operating system version
Android 15
Application version and app store
Element X 0.7.6 Play Store
Homeserver
matrix.org
Will you send logs?
No
Are you willing to provide a PR?
No
The text was updated successfully, but these errors were encountered: