Skip to content
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

feat: strip prefixes and suffixes in links #5486

Merged
merged 7 commits into from
Jul 14, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jun 28, 2024

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).

Copy link
Contributor

@github-actions github-actions bot left a comment

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

tests/src/LinkParser.cpp Outdated Show resolved Hide resolved
tests/src/LinkParser.cpp Outdated Show resolved Hide resolved
@pajlada pajlada merged commit b9f669d into Chatterino:master Jul 14, 2024
17 checks passed
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