-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
non-URI characters should be excluded from the link parser #4769
Comments
Added a PR to help with this #4778 |
I would prefer if the approach to fix this tackled the most user-facing problems, compared to patching tiny situations where a non-existent link is shown. Though this would likely require more of a refactor as it would result in two message elements. Similar to the above mentioned examples that automatically handle this problem: examples where the link fails to load |
I think parsing a link like this should work:
This could be stored in a result like this1: struct Link {
QStringView prefix;
QStringView link;
QStringView suffix;
QStringView protocol;
QStringView host;
QStringView rest;
QString source;
}; If The possible prefixes should be Footnotes
|
Checklist
Describe your issue
Currently when you use a valid tld, the link parser doesn't check whether the domain characters are valid or not.
There are really 2 approaches you could go with this, you can either URI encode the characters within the white-space, imo that's unnatural and doesn't feel right for a chat program. The better thing to do is just exclude them like webchat does.
Screenshots
c2:
webchat:
OS and Chatterino Version
Chatterino Nightly 2.4.4 (commit 381d5c4) built on 2023-08-14 with Qt 5.15.2, MSVC 193532217 Running on Windows 10 Version 2009, kernel: 10.0.22621
The text was updated successfully, but these errors were encountered: