From e2baff310c6515b0a8542385b1c3e28ab057c733 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 9 Jun 2023 10:43:59 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/8478 --- app/src/protyle/toolbar/util.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/protyle/toolbar/util.ts b/app/src/protyle/toolbar/util.ts index 878c08fb2..f177d7f6a 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;