Skip to content

feat: strip prefixes and suffixes in links - #5486

Merged
pajlada merged 7 commits into
Chatterino:masterfrom
Nerixyz:feat/ignore-link-stuff
Jul 14, 2024
Merged

pajlada merged 7 commits into
Chatterino:masterfrom
Nerixyz:feat/ignore-link-stuff

Conversation

@Nerixyz

@Nerixyz Nerixyz commented Jun 28, 2024 •

Copy link
Copy Markdown
Contributor

This PR makes the link parser aware of prefixes and suffixes in links. Both are identical to the ones accepted on GitHub (prefixes: <, *, _, ~, (; suffixes: >, ?, !, ., ,, :, *, ~), however, the implementation doesn't count the number of parentheses. Additionally, _ isn't a valid suffix, because I expect valid links to have _ as a suffix (e.g. twitch.tv/__xX_The_Gamer_Xx__).

This adds a few more tests too.

Towards #4769 (we don't check for some weird characters in hostnames yet).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread tests/src/LinkParser.cpp Outdated
Comment thread tests/src/LinkParser.cpp Outdated
@pajlada
pajlada merged commit b9f669d into Chatterino:master Jul 14, 2024
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.

2 participants