An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/12868
Vanessa22e954c4e785
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex ba9f85a33c..3740c1b638 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -696,7 +696,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {// 页面按向下/右箭头丢失焦点 https://ld246.com/article/1629954026096const lastEditElement = getContenteditableElement(nodeElement);// 代码块需替换最后一个 /n https://github.com/siyuan-note/siyuan/issues/3221- if (lastEditElement && lastEditElement.textContent.replace(/\n$/, "").length <= getSelectionOffset(lastEditElement, undefined, range).end) {+ if (lastEditElement && !lastEditElement.querySelector(".emoji") && lastEditElement.textContent.replace(/\n$/, "").length <= getSelectionOffset(lastEditElement, undefined, range).end) {event.stopPropagation();event.preventDefault();focusByRange(range);@@ -860,7 +860,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {const currentNode = range.startContainer.childNodes[range.startOffset - 1] as HTMLElement;if (position.start === 0 && (range.startOffset === 0 ||- (currentNode && currentNode.nodeType === 3 && !hasPreviousSibling(currentNode) && currentNode.innerText === "") // https://ld246.com/article/1649251218696+ (currentNode && currentNode.nodeType === 3 && !hasPreviousSibling(currentNode) &&+ // 需使用 textContent,文本元素没有 innerText+ currentNode.textContent === "") // https://ld246.com/article/1649251218696)) {removeBlock(protyle, nodeElement, range, "Backspace");event.stopPropagation();diff --git a/app/src/protyle/wysiwyg/remove.ts b/app/src/protyle/wysiwyg/remove.tsindex 1869605f19..e50e8a4c6e 100644--- a/app/src/protyle/wysiwyg/remove.ts+++ b/app/src/protyle/wysiwyg/remove.ts@@ -389,7 +389,7 @@ export const removeBlock = (protyle: IProtyle, blockElement: Element, range: RanfocusBlock(previousLastElement, undefined, false);} else {const previousLastEditElement = getContenteditableElement(previousLastElement);- if (editableElement && editableElement.textContent !== "") {+ if (editableElement && (editableElement.textContent !== "" || editableElement.querySelector(".emoji"))) {// 非空块range.setEndAfter(editableElement.lastChild);// 数学公式回车后再删除 https://github.com/siyuan-note/siyuan/issues/3850