Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art:

Vanessae9bddf922477
diff --git a/app/src/protyle/util/destroy.ts b/app/src/protyle/util/destroy.ts
index 6c22d91df3..a635e3ab75 100644
--- a/app/src/protyle/util/destroy.ts
+++ b/app/src/protyle/util/destroy.ts
@@ -1,14 +1,17 @@
import {hideElements} from "../ui/hideElements";
+import {isSupportCSSHL} from "../render/searchMarkRender";
export const destroy = (protyle: IProtyle) => {
if (!protyle) {
return;
}
hideElements(["util"], protyle);
- protyle.highlight.markHL.clear();
- protyle.highlight.mark.clear();
- protyle.highlight.ranges = [];
- protyle.highlight.rangeIndex = 0;
+ if (isSupportCSSHL()) {
+ protyle.highlight.markHL.clear();
+ protyle.highlight.mark.clear();
+ protyle.highlight.ranges = [];
+ protyle.highlight.rangeIndex = 0;
+ }
protyle.observer?.disconnect();
protyle.observerLoad?.disconnect();
protyle.element.classList.remove("protyle");