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
Use TwitterText regex for valid domains in mentions to support more domains #25890
base: main
Are you sure you want to change the base?
Conversation
Could you add a test for this? |
I added a test for my specific case. Are there any other tests you'd like me to add? :) |
I'm not sure whether this is a good idea, emoji are not in general properly supported in domain names, and I'm not sure this is worth the additional complexity and possible edge cases. There is also an aspect of mention processing that happens client-side, for auto-completion, unexpected mentions check, and counting characters. This PR only addresses the server-side aspect, which would lead to inconsistent character count when mentioning |
Auto completion on the client side already inserts I'd be happy to make the necessary client side changes as well, if you could point me to the right places. And as far as emojis in domain names in general go, every browser I tested supports them just fine (sometimes converting to punycode (Firefox), sometimes not (Safari)). |
Ah, I missed this bit of context.
This currently happens through a regexp in |
@ClearlyClaire I just pushed the changes to Let me know if there's anything else! |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
I fixed the linting issues. Still want to get this merged, please let me know if there's anything else I should do :) |
@renchap @ClearlyClaire I still would like to get this merged. I updated the fork again, is there anything else you need to me to change? |
TwitterText already has a regex to check for valid domains that allows a few domains the current Regex did not allow. Mainly it allows mentions of accounts on domains with emoji in their domain names to be processed correctly. Mentions like `@test@🌈🌈🌈.st` will now work correctly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #25890 +/- ##
=======================================
Coverage 85.08% 85.08%
=======================================
Files 1038 1038
Lines 28159 28159
Branches 4533 4533
=======================================
Hits 23959 23959
Misses 3039 3039
Partials 1161 1161 ☔ View full report in Codecov by Sentry. |
TwitterText already has a regex to check for valid domains that allows a few domains the current Regex did not allow. Mainly it allows mentions of accounts on domains with emoji in their domain names to be processed correctly.
Mentions like
@test@🌈🌈🌈.st
will now work correctly.This would fix #20422 (and maybe other special characters in domains as well?) and thus solve the biggest hurdle for having a mastodon instance on domains with emojis.