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/siyuan/issues/6710#issuecomment-1364624554

Vanessa04ac71298871
diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts
index 8219dc4784..858b2efeec 100644
--- a/app/src/card/makeCard.ts
+++ b/app/src/card/makeCard.ts
@@ -32,6 +32,9 @@ export const makeCard = (nodeElement: Element[]) => {
let html = "";
const ids: string[] = [];
nodeElement.forEach(item => {
+ if (item.getAttribute("data-type") === "NodeThematicBreak") {
+ return;
+ }
ids.push(item.getAttribute("data-node-id"));
});
response.data.forEach((item: ICard) => {
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index c192e49dc7..38affbddbb 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -1437,14 +1437,16 @@ export class Gutter {
}
}).element);
}
- window.siyuan.menus.menu.append(new MenuItem({
- label: window.siyuan.languages.riffCard,
- icon: "iconRiffCard",
- click() {
- makeCard([nodeElement]);
- }
- }).element);
- window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
+ if (type !== "NodeThematicBreak") {
+ window.siyuan.menus.menu.append(new MenuItem({
+ label: window.siyuan.languages.riffCard,
+ icon: "iconRiffCard",
+ click() {
+ makeCard([nodeElement]);
+ }
+ }).element);
+ window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
+ }
let updateHTML = nodeElement.getAttribute("updated") || "";
if (updateHTML) {
updateHTML = `${window.siyuan.languages.modifiedAt} ${dayjs(updateHTML).format("YYYY-MM-DD HH:mm:ss")}<br>`;
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index da049c619d..b20f1c1fb5 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -446,6 +446,9 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b
return;
}
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => {
+ if (item.getAttribute("data-type") === "NodeThematicBreak") {
+ return;
+ }
Object.keys(data.old).forEach(key => {
item.removeAttribute(key);
});