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/6319

Vanessa0303234704be
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index a6527bf17a..148c1f2458 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -296,7 +296,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
});
undoOperations.reverse();
if (newSourceElement.getAttribute("data-subtype") === "o") {
- undoOperations.splice(0, 0,{
+ undoOperations.splice(0, 0, {
action: "update",
id: newSourceElement.getAttribute("data-node-id"),
data: newSourceElement.outerHTML
@@ -383,7 +383,7 @@ const dragSame = (protyle: IProtyle, sourceElements: Element[], targetElement: E
});
undoOperations.reverse();
if (newSourceElement.getAttribute("data-subtype") === "o") {
- undoOperations.splice(0, 0,{
+ undoOperations.splice(0, 0, {
action: "update",
id: newSourceElement.getAttribute("data-node-id"),
data: newSourceElement.outerHTML
@@ -590,10 +590,12 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
const selectedIdsData = window.siyuan.dragElement.getAttribute("data-selected-ids");
const selectedIds = selectedIdsData ? selectedIdsData.split(",") : [window.siyuan.dragElement.getAttribute("data-node-id")];
selectedIds.forEach(item => {
- const selectElement = window.siyuan.dragElement.parentElement.parentElement.querySelector(`.protyle-wysiwyg [data-node-id="${item}"]`);
- if (selectElement) {
- sourceElements.push(selectElement);
- }
+ window.siyuan.dragElement.parentElement.parentElement.querySelectorAll(`.protyle-wysiwyg [data-node-id="${item}"]`).forEach(elementItem => {
+ if (elementItem.getAttribute("data-type") === "NodeBlockQueryEmbed" ||
+ !hasClosestByAttribute(elementItem, "data-type", "NodeBlockQueryEmbed")) {
+ sourceElements.push(elementItem);
+ }
+ });
});
sourceElements.forEach(item => {
item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");