mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
FIX: censored regex words were replacing other text that shouldn't be censored
This commit is contained in:
parent
594efa37b6
commit
dc97239040
2 changed files with 15 additions and 3 deletions
|
@ -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");
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue