From b023e81078ec967efa531af796ff568decc1a9e1 Mon Sep 17 00:00:00 2001 From: Dean Taylor Date: Fri, 17 Oct 2014 03:10:30 +0100 Subject: [PATCH] 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`. --- test/javascripts/lib/markdown-test.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/javascripts/lib/markdown-test.js.es6 b/test/javascripts/lib/markdown-test.js.es6 index 08eb2f87d49..2fa4f7066c5 100644 --- a/test/javascripts/lib/markdown-test.js.es6 +++ b/test/javascripts/lib/markdown-test.js.es6 @@ -481,11 +481,14 @@ test("images", function() { }); test("censoring", function() { - Discourse.SiteSettings.censored_words = "shucks|whiz"; + Discourse.SiteSettings.censored_words = "shucks|whiz|whizzer"; cooked("aw shucks, golly gee whiz.", "

aw ■■■■■■, golly gee ■■■■.

", "it censors words in the Site Settings"); cooked("you are a whizzard! I love cheesewhiz. Whiz.", "

you are a whizzard! I love cheesewhiz. ■■■■.

", "it doesn't censor words unless they have boundaries."); + cooked("you are a whizzer! I love cheesewhiz. Whiz.", + "

you are a ■■■■■■■! I love cheesewhiz. ■■■■.

", + "it censor words even if previous partical matches exist."); });