From 1cfe63c64fa346e10be497f3d0dc0ed8373dfb9a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 17 Mar 2023 23:41:30 +0800 Subject: [PATCH] :bug: search --- app/src/search/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 361c12f65..a5f472bbd 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -1139,6 +1139,7 @@ const renderNextSearchMark = (options: { options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + matchElement.getBoundingClientRect().top - contentRect.top - contentRect.height / 2; } }; + const getArticle = (options: { id: string, k: string, @@ -1155,7 +1156,7 @@ const getArticle = (options: { zoom: foldResponse.data, }, getResponse => { onGet(getResponse, options.edit.protyle, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HL, Constants.CB_GET_HTML]); - const matchElement = options.edit.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type="search-mark"]`); + const matchElement = options.edit.protyle.wysiwyg.element.querySelector(`div[data-node-id="${options.id}"] span[data-type~="search-mark"]`); if (matchElement) { matchElement.classList.add("search-mark--hl"); const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();