FIX: Censored word match fail if earlier partial match
Previously a list containing `one|two|three|four|twoagain` would fail to censor the word `twoagain` in the text `test1 twoagain test2`.
This commit is contained in:
parent
0a5acba77e
commit
b023e81078
|
@ -481,11 +481,14 @@ test("images", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("censoring", function() {
|
test("censoring", function() {
|
||||||
Discourse.SiteSettings.censored_words = "shucks|whiz";
|
Discourse.SiteSettings.censored_words = "shucks|whiz|whizzer";
|
||||||
cooked("aw shucks, golly gee whiz.",
|
cooked("aw shucks, golly gee whiz.",
|
||||||
"<p>aw ■■■■■■, golly gee ■■■■.</p>",
|
"<p>aw ■■■■■■, golly gee ■■■■.</p>",
|
||||||
"it censors words in the Site Settings");
|
"it censors words in the Site Settings");
|
||||||
cooked("you are a whizzard! I love cheesewhiz. Whiz.",
|
cooked("you are a whizzard! I love cheesewhiz. Whiz.",
|
||||||
"<p>you are a whizzard! I love cheesewhiz. ■■■■.</p>",
|
"<p>you are a whizzard! I love cheesewhiz. ■■■■.</p>",
|
||||||
"it doesn't censor words unless they have boundaries.");
|
"it doesn't censor words unless they have boundaries.");
|
||||||
|
cooked("you are a whizzer! I love cheesewhiz. Whiz.",
|
||||||
|
"<p>you are a ■■■■■■■! I love cheesewhiz. ■■■■.</p>",
|
||||||
|
"it censor words even if previous partical matches exist.");
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue