Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/14290

Vanessafe6132646dde
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 4a5d4bd1d7..17df7129b9 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -606,7 +606,9 @@ export class Toolbar {
let previousElement = i === newNodes.length ? newNodes[i - 1] as HTMLElement : hasPreviousSibling(newNodes[i]) as HTMLElement;
if (previousElement.nodeType === 3 && previousElement.textContent === Constants.ZWSP) {
previousElement = hasPreviousSibling(previousElement) as HTMLElement;
- previousElement.nextSibling.remove();
+ if(previousElement) {
+ previousElement.nextSibling.remove();
+ }
}
let currentNode = newNodes[i] as HTMLElement;
if (!currentNode) {