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