Jelajahi Sumber

:bug: search

Vanessa 2 tahun lalu
induk
melakukan
1cfe63c64f
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      app/src/search/util.ts

+ 2 - 1
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;
         options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + matchElement.getBoundingClientRect().top - contentRect.top - contentRect.height / 2;
     }
     }
 };
 };
+
 const getArticle = (options: {
 const getArticle = (options: {
     id: string,
     id: string,
     k: string,
     k: string,
@@ -1155,7 +1156,7 @@ const getArticle = (options: {
             zoom: foldResponse.data,
             zoom: foldResponse.data,
         }, getResponse => {
         }, getResponse => {
             onGet(getResponse, options.edit.protyle, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HL, Constants.CB_GET_HTML]);
             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) {
             if (matchElement) {
                 matchElement.classList.add("search-mark--hl");
                 matchElement.classList.add("search-mark--hl");
                 const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();
                 const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();