Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/8478

Vanessae2baff310c65
diff --git a/app/src/protyle/toolbar/util.ts b/app/src/protyle/toolbar/util.ts
index 878c08fb27..f177d7f6a5 100644
--- a/app/src/protyle/toolbar/util.ts
+++ b/app/src/protyle/toolbar/util.ts
@@ -14,6 +14,9 @@ export const previewTemplate = (pathString: string, element: Element, parentId:
};
const mergeElement = (a: Element, b: Element, after = true) => {
+ if (!a.getAttribute("data-type") || !b.getAttribute("data-type")) {
+ return false;
+ }
a.setAttribute("data-type", a.getAttribute("data-type").replace("search-mark", "").trim());
b.setAttribute("data-type", b.getAttribute("data-type").replace("search-mark", "").trim());
const attributes = a.attributes;