Vanessa 2024-12-02 00:10:03 +08:00
parent 3a53fd4a9a
commit fdee19e703
6 changed files with 16 additions and 15 deletions

View file

@ -15,13 +15,15 @@ export const searchMarkRender = (protyle: IProtyle, matchElements: NodeListOf<El
item.setAttribute("data-type", item.getAttribute("data-type").replace(" search-mark", "").replace("search-mark ", ""));
range.selectNodeContents(item);
}
if (index === protyle.highlight.rangeIndex) {
if (index === protyle.highlight.rangeIndex && !protyle.options.backlinkData) {
protyle.highlight.markHL.add(range);
} else {
protyle.highlight.mark.add(range);
}
protyle.highlight.ranges.push(range);
});
CSS.highlights.set("search-mark", protyle.highlight.mark);
CSS.highlights.set("search-mark-hl", protyle.highlight.markHL);
CSS.highlights.set("search-mark-" + protyle.highlight.styleElement.dataset.uuid, protyle.highlight.mark);
if (!protyle.options.backlinkData) {
CSS.highlights.set("search-mark-hl-" + protyle.highlight.styleElement.dataset.uuid, protyle.highlight.markHL);
}
};