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

The positive look ahead should include punctuation marks (, ! ? : ;) #15

Closed
ggrossetie opened this issue Jan 1, 2021 · 2 comments · Fixed by #17
Closed

The positive look ahead should include punctuation marks (, ! ? : ;) #15

ggrossetie opened this issue Jan 1, 2021 · 2 comments · Fixed by #17

Comments

@ggrossetie
Copy link
Contributor

Currently, the regular expression use only space, dot followed by a space, dot at the end of the line and end of line:

return new RegExp(`(?:^|[^-\\w])(${wordPattern}(?= |\\. |\\.$|$))`, 'ig');

In other words, it won't match in the following cases:

add up?
add up!
add up, and subtract.
add up; and subtract.
add up: 10

Using word boundary (\b) is probably a bad idea but adding common punctuation marks seems reasonable. What do you think?

@sapegin
Copy link
Owner

sapegin commented Jan 4, 2021

Yeah, this sounds like a good idea! Mind sending a pull request? 👾

ggrossetie added a commit to ggrossetie/textlint-rule-stop-words that referenced this issue Jan 4, 2021
ggrossetie added a commit to ggrossetie/textlint-rule-stop-words that referenced this issue Jan 4, 2021
ggrossetie added a commit to ggrossetie/textlint-rule-stop-words that referenced this issue Jan 4, 2021
sapegin pushed a commit that referenced this issue Jan 5, 2021
@sapegin
Copy link
Owner

sapegin commented Jan 5, 2021

🎉 This issue has been resolved in version 2.0.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants