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/insider/issues/1056

Vanessa8920697029b6
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 0e37d51be5..6fcc8ce0f3 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -507,6 +507,10 @@ export class Toolbar {
this.range.setEnd(lastNewNode.lastChild, lastNewNode.lastChild.textContent.length);
} else if (lastNewNode.nodeType === 3) {
this.range.setEnd(lastNewNode, lastNewNode.textContent.length);
+ if (lastNewNode.textContent === Constants.ZWSP) {
+ // https://github.com/siyuan-note/insider/issues/1056
+ this.range.collapse(false);
+ }
} else {
// eg: 表格中有3行时,选中第二行三级,多次加粗会增加换行
this.range.setEndAfter(lastNewNode);