mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FIX: censored regex words were replacing other text that shouldn't be censored
This commit is contained in:
@ -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");
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user