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

fix: don't match a trailing period after the path #29

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

birtles
Copy link
Contributor

@birtles birtles commented Aug 14, 2023

Fixes #17.

This also extends trailingPeriod: false (the default) to exclude
matching a trailing question mark (?) or exclamation mark (!).

That is if you want "Check out example.com/project." to NOT match the
trailing period, you typically also want it to NOT match the trailing
exclamation mark in "Check out example.com/project!".
Likewise for "Have you seen example.com/project?".

I guess technically trailingPeriod should be renamed
trailingPunctuation but maybe it's fine as-is?

Checklist

  • I have ensured my pull request is not behind the main or master branch of the original repository.
  • I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
  • I have written a commit message that passes commitlint linting.
  • I have ensured that my code changes pass linting tests.
  • I have ensured that my code changes pass unit tests.
  • I have described my pull request and the reasons for code changes along with context if necessary.

Fixes spamscanner#17.

This also extends `trailingPeriod: false` (the default) to exclude
matching a trailing question mark (?) or exclamation mark (!).

That is if you want "Check out example.com/project." to NOT match the
trailing period, you typically also want it to NOT match the trailing
exclamation mark in "Check out example.com/project!".
Likewise for "Have you seen example.com/project?".

I guess technically `trailingPeriod` should be renamed
`trailingPunctuation` but maybe it's fine as-is?
@titanism
Copy link
Contributor

Amazing work! 🙏 Thank you!

@titanism titanism merged commit ad2a39b into spamscanner:master Aug 15, 2023
2 checks passed
@birtles birtles deleted the trailing-periods branch August 15, 2023 04:33
@titanism
Copy link
Contributor

Publishing now, one moment

@titanism
Copy link
Contributor

v4.0.0 released with this, thank you @birtles

release notes @ https://github.com/spamscanner/url-regex-safe/releases/tag/v4.0.0

note: this version now requires node v14+

This pull request was closed.
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.

trailingPeriod setting not honored on subdomains
2 participants