mirror of
https://github.com/tooot-app/app
synced 2024-12-21 07:13:15 +01:00
Fixed #530 thanks to ChatGPT
This commit is contained in:
parent
5239fb83c6
commit
c89612d875
@ -1,3 +1,2 @@
|
||||
Enjoy toooting! This version includes following improvements and fixes:
|
||||
- Fix toot attribution of favourites etc.
|
||||
- Fix switching language
|
||||
- Fix whole word filter matching
|
@ -1,3 +1,2 @@
|
||||
toooting愉快!此版本包括以下改进和修复:
|
||||
- 修复嘟文收藏等显示
|
||||
- 修复不能切换语言
|
||||
- 修复过滤整词功能
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tooot",
|
||||
"version": "4.6.6",
|
||||
"version": "4.7.0",
|
||||
"description": "tooot for Mastodon",
|
||||
"author": "xmflsct <me@xmflsct.com>",
|
||||
"license": "GPL-3.0-or-later",
|
||||
|
@ -72,12 +72,12 @@ export const shouldFilter = ({
|
||||
const escapedPhrase = filter.phrase.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // $& means the whole matched string
|
||||
switch (filter.whole_word) {
|
||||
case true:
|
||||
if (new RegExp(`\\B${escapedPhrase}\\b`).test(rawContent)) {
|
||||
if (new RegExp(`\\b${escapedPhrase}\\b`, 'i').test(rawContent)) {
|
||||
shouldFilter = filter.phrase
|
||||
}
|
||||
break
|
||||
case false:
|
||||
if (new RegExp(escapedPhrase).test(rawContent)) {
|
||||
if (new RegExp(escapedPhrase, 'i').test(rawContent)) {
|
||||
shouldFilter = filter.phrase
|
||||
}
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user