FIX: censored regex words were replacing other text that shouldn't be censored

This commit is contained in:
Neil Lalonde
2018-01-24 12:33:38 -05:00
parent 594efa37b6
commit dc97239040
2 changed files with 15 additions and 3 deletions

View File

@ -617,7 +617,18 @@ QUnit.test("censoring", assert => {
},
censoredWords: 'xyz*|plee+ase'
},
"<p>Pleased to meet you, but ■■■■■■■■■ call me later, ■■■123</p>",
"<p>Pleased to meet you, but ■■■■ call me later, ■■■123</p>",
"supports words as regular expressions");
assert.cookedOptions(
"Meet downtown in your town at the townhouse on Main St.",
{ siteSettings: {
watched_words_regular_expressions: true,
censored_pattern: null
},
censoredWords: '\\btown\\b'
},
"<p>Meet downtown in your ■■■■ at the townhouse on Main St.</p>",
"supports words as regular expressions");
});