FIX: censored words should support * as wildcard

This commit is contained in:
Neil Lalonde
2018-01-09 15:51:47 -05:00
parent 61384c8026
commit ad62f1099c
2 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,7 @@ const rawOpts = {
default_code_lang: 'auto',
censored_pattern: '\\d{3}-\\d{4}|tech\\w*'
},
censoredWords: 'shucks|whiz|whizzer|a**le',
censoredWords: 'shucks|whiz|whizzer|a**le|badword*',
getURL: url => url
};
@ -604,6 +604,9 @@ QUnit.test("censoring", assert => {
assert.cooked("I have a pen, I have an a**le",
"<p>I have a pen, I have an ■■■■■</p>",
"it escapes regexp chars");
assert.cooked("No badword or apple here plz.",
"<p>No ■■■■■■■ or ■■■■■ here plz.</p>",
"it handles * as wildcard");
});
QUnit.test("code blocks/spans hoisting", assert => {