Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/5891

Vanessa8f73915322cb
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 99bb31bdf4..afe4d37c2b 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -129,7 +129,7 @@ class Protyle {
}
}
// update ref
- this.protyle.wysiwyg.element.querySelectorAll(`[data-type="~block-ref"][data-id="${data.data.id}"]`).forEach(item => {
+ this.protyle.wysiwyg.element.querySelectorAll(`[data-type~="block-ref"][data-id="${data.data.id}"]`).forEach(item => {
if (item.getAttribute("data-subtype") === "d") {
item.textContent = data.data.title;
}
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index e4616c9824..890ae46ccb 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -578,15 +578,17 @@ export class Toolbar {
protyle.toolbar.showRender(protyle, newNodes[0] as HTMLElement, undefined, html);
return;
}
- }
- if (type === "inline-memo") {
+ } else if (type === "inline-memo") {
protyle.toolbar.showRender(protyle, newNodes[0] as HTMLElement, newNodes as Element[], html);
return;
- }
- if (type === "a") {
+ } else if (type === "block-ref") {
+ this.range.collapse(false);
+ } else if (type === "a") {
const aElement = newNodes[0] as HTMLElement
if (aElement.textContent.replace(Constants.ZWSP, "") === "" || !aElement.getAttribute("data-href")) {
linkMenu(protyle, aElement, aElement.getAttribute("data-href") ? true : false);
+ } else {
+ this.range.collapse(false);
}
}
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));