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

Consecutive banned words in a comment text will make this comment text display incorrectly in Moderation section #2908

Open
HectorNM opened this issue Mar 25, 2020 · 1 comment
Labels
bug

Comments

@HectorNM
Copy link
Contributor

@HectorNM HectorNM commented Mar 25, 2020

While testing regular expressions, I tried to change a test existing on CommentContext.spec.tsx to include consecutive banned words, line breaks, word in the beginning and end of the line. Like in the image below:

image

However, when running this test, I found that once I put consecutive banned words, the HTML marking would be placed mistakenly in non-banned words in that comment, like in blank spaces. Please note the Received in red in the image below. Besides, as you can see, banned words are not marked as banned:

image

I was trying to understand the problem, and I ended up coding a solution. I'm opening a PR for this solution, please check if it makes sense for you.

Expected behavior:
When typing two consecutive words that are banned in a comment, it'll mark these banned words correctly in moderation section.

Actual behavior:
Consecutive banned words are not marked properly in moderation section.

Related Issues:

Versions:

  • NodeJS: 12.16.0
  • NPM: 6.13.4
  • MongoDB: 3.6
  • Redis: 3.2
  • Browser: Chrome 80.0.3987.149 64 bits
  • OS: macOS Catalina 10.15.2
@HectorNM

This comment has been minimized.

Copy link
Contributor Author

@HectorNM HectorNM commented Mar 25, 2020

I opened a PR for a possible solution for this problem, please see if it makes sense for you: #2909

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.