From bb81986cb0cedacc262567275eb5b4f348ca4ac9 Mon Sep 17 00:00:00 2001 From: rhahao <26148770+rhahao@users.noreply.github.com> Date: Wed, 13 Dec 2023 23:22:05 +0300 Subject: [PATCH] fix(utils): fix word boundaries position --- src/current/utils/sourceMaterial.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/current/utils/sourceMaterial.js b/src/current/utils/sourceMaterial.js index 438d7e9cc4..4cc72abd01 100644 --- a/src/current/utils/sourceMaterial.js +++ b/src/current/utils/sourceMaterial.js @@ -179,7 +179,7 @@ export const checkAYFExplainingBeliefsAssignment = (source) => { const boundary = '(?:^|\\s|$)'; const talk = t('talk', { lng: Setting.source_lang, ns: 'source' }); const demonstration = t('demonstration', { lng: Setting.source_lang, ns: 'source' }); - const searchKey = boundary + `${talk}|${demonstration}` + boundary; + const searchKey = `${boundary}${talk}|${boundary}${demonstration}`; const regex = new RegExp(searchKey, 'i'); const result = source.match(regex);