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: fix https://github.com/siyuan-note/siyuan/issues/6131
Vanessa395223d701aa
diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yamlindex ff30b4a5da..78f9abaf27 100644--- a/app/pnpm-lock.yaml+++ b/app/pnpm-lock.yaml@@ -1906,10 +1906,10 @@ packages:resolution: {integrity: sha512-m0+M53+HYMzqKxwNQZT143K7WwXEGUy9LY31l8dJphXx2P/FQod615mVbxHyqbDCG4J5bHdWm21qZ0e2DVY6CQ==}engines: {node: '>=14.0.0'}dependencies:- 7zip-bin: 5.1.1'@develar/schema-utils': 2.6.5'@electron/universal': 1.2.1'@malept/flatpak-bundler': 0.4.0+ 7zip-bin: 5.1.1async-exit-hook: 2.0.1bluebird-lst: 1.0.9builder-util: 23.3.3@@ -2193,9 +2193,9 @@ packages:/builder-util/23.3.3:resolution: {integrity: sha512-MJZlUiq2PY5hjYv9+XNaoYdsITqvLgRDoHSFg/4nzpInbNxNjLQOolL04Zsyp+hgfcbFvMC4h0KkR1CMPHLWbA==}dependencies:- 7zip-bin: 5.1.1'@types/debug': 4.1.7'@types/fs-extra': 9.0.13+ 7zip-bin: 5.1.1app-builder-bin: 4.0.0bluebird-lst: 1.0.9builder-util-runtime: 9.0.3diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.tsindex 756fa0f235..ab91020109 100644--- a/app/src/protyle/util/editorCommonEvent.ts+++ b/app/src/protyle/util/editorCommonEvent.ts@@ -39,7 +39,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Eleaction: "move",id: targetElement.getAttribute("data-node-id"),previousID: targetElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: targetElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: targetElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID}];let topSourceElement: Element;let oldSourceParentElement = sourceElements[0].parentElement;@@ -50,7 +50,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Eledata: sbElement.outerHTML,id: sbElement.getAttribute("data-node-id"),previousID: sbElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: sbElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID+ parentID: sbElement.parentElement.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID}];if (newSourceElement) {sbElement.insertAdjacentElement("afterbegin", targetElement);@@ -74,7 +74,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Eledata: newSourceElement.outerHTML,id: newSourceElement.getAttribute("data-node-id"),previousID: newSourceElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID});}sourceElements.reverse().forEach((item, index) => {@@ -197,7 +197,7 @@ const dragSb = (protyle: IProtyle, sourceElements: Element[], targetElement: Eledata: topSourceElement.outerHTML,id: topSourceElement.getAttribute("data-node-id"),previousID: topSourceElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: topSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: topSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID});if (!isSameDoc) {// 打开两个相同的文档@@ -340,7 +340,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: Edata: newSourceElement.outerHTML,id: newSourceElement.getAttribute("data-node-id"),previousID: newSourceElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: newSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID});sourceElements.reverse().forEach((item, index) => {if (index === sourceElements.length - 1) {@@ -400,7 +400,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: Eaction: "move",id: item.getAttribute("data-node-id"),previousID: item.previousElementSibling?.getAttribute("data-node-id"),- parentID: item.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: item.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID});});undoOperations.reverse();@@ -475,7 +475,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: Edata: topSourceElement.outerHTML,id: topSourceElement.getAttribute("data-node-id"),previousID: topSourceElement.previousElementSibling?.getAttribute("data-node-id"),- parentID: topSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID+ parentID: topSourceElement.parentElement?.getAttribute("data-node-id") || protyle.block.parentID || protyle.block.rootID});oldSourceParentElement = topSourceElement.parentElement;topSourceElement.remove();@@ -618,6 +618,10 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {});sourceElements.forEach(item => {item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");+ // 反链提及有高亮,如果拖拽到正文的话,应移除+ item.querySelectorAll('[data-type="search-mark"]').forEach(markItem => {+ markItem.outerHTML = markItem.innerHTML;+ })});if (event.altKey) {focusByRange(document.caretRangeFromPoint(event.clientX, event.clientY));diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 948f52ed6c..63d358cd14 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -707,7 +707,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {}// 行首转义符前删除 https://github.com/siyuan-note/siyuan/issues/6092if (range.startOffset === 0 &&- previousSibling && previousSibling.parentElement.getAttribute("data-type").indexOf("backslash") > -1 &&+ previousSibling && previousSibling.parentElement.getAttribute("data-type")?.indexOf("backslash") > -1 &&previousSibling.nodeType !== 3 && (previousSibling as HTMLElement).outerHTML === "<span>\\</span>" &&!hasPreviousSibling(previousSibling)) {range.setStartBefore(previousSibling.parentElement);