mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
core: escape paranthesis in notes search query
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -1154,7 +1154,8 @@ function textContainsTokens(text: string, tokens: QueryTokens) {
|
||||
const lowerCasedText = text.toLowerCase();
|
||||
|
||||
const createTagPattern = (token: string) => {
|
||||
return `<${MATCH_TAG_NAME}\\s+id="(.+?)">${token}<\\/${MATCH_TAG_NAME}>`;
|
||||
const escapedToken = token.replace(/[()]/g, "\\$&");
|
||||
return `<${MATCH_TAG_NAME}\\s+id="(.+?)">${escapedToken}<\\/${MATCH_TAG_NAME}>`;
|
||||
};
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user