Skip to content

fix: disallow more characters in links - #5509

Merged
pajlada merged 3 commits into
Chatterino:masterfrom
Nerixyz:fix/check-link-chars
Jul 20, 2024
Merged

pajlada merged 3 commits into
Chatterino:masterfrom
Nerixyz:fix/check-link-chars

Conversation

@Nerixyz

@Nerixyz Nerixyz commented Jul 14, 2024

Copy link
Copy Markdown
Contributor

As mentioned in #5486, this is the "second" part at making the link parser a bit better. This PR disallows characters from ASCII that aren't valid in domains. Similar to what GFM considers a valid domain, 0-9, A-Z, a-z, '-', '_', and '.' are allowed. However, since the parser should be able to parse "domains" that actually require punycode like https://köln.de, all characters outside ASCII are allowed. I think it's fine to allow these, even though it's a bit wrong.

Fixes #4769.

@Nerixyz
Nerixyz force-pushed the fix/check-link-chars branch from 8da3bcb to 528662c Compare July 14, 2024 16:22
@pajlada
pajlada enabled auto-merge (squash) July 20, 2024 09:38
@pajlada
pajlada merged commit 4a7a5b0 into Chatterino:master Jul 20, 2024
@Nerixyz
Nerixyz deleted the fix/check-link-chars branch July 20, 2024 10:32
babicekmarek pushed a commit to babicekmarek/streamally-chatterino that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

non-URI characters should be excluded from the link parser

2 participants