Vanessa 2024-12-07 11:19:57 +08:00
parent 04806ea4b9
commit 594e7f8cee
7 changed files with 36 additions and 29 deletions

View file

@ -1,5 +1,5 @@
export const searchMarkRender = (protyle: IProtyle, matchElements: NodeListOf<Element>) => {
if (matchElements.length === 0 || !CSS || !CSS.highlights) {
export const searchMarkRender = (protyle: IProtyle, keys: string[]) => {
if (!isSupportCSSHL()) {
return;
}
protyle.highlight.markHL.clear();
@ -30,7 +30,11 @@ export const searchMarkRender = (protyle: IProtyle, matchElements: NodeListOf<El
export const searchTextMarkRender = (element: HTMLElement, k: string[]) => {
if (!CSS || !CSS.highlights) {
if (!isSupportCSSHL()) {
return;
}
}
export const isSupportCSSHL = () => {
return !!(CSS && CSS.highlights);
}