From 316096cf571de138c313affa9f34b37bb03a75cd Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Wed, 1 Jun 2022 23:39:48 +0200 Subject: [PATCH] Fixed #310 --- src/components/Timeline/Shared/Filtered.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Timeline/Shared/Filtered.tsx b/src/components/Timeline/Shared/Filtered.tsx index 661182fa..f6e10994 100644 --- a/src/components/Timeline/Shared/Filtered.tsx +++ b/src/components/Timeline/Shared/Filtered.tsx @@ -55,7 +55,7 @@ export const shouldFilter = ({ ) // $& means the whole matched string switch (filter.whole_word) { case true: - if (new RegExp('\\B' + escapedPhrase + '\\B').test(text)) { + if (new RegExp('\\b' + escapedPhrase + '\\b').test(text)) { shouldFilter = true } break @@ -100,6 +100,7 @@ export const shouldFilter = ({ }) } }) + status.spoiler_text && parser.write(status.spoiler_text) parser.write(status.content) parser.end() }