diff --git a/app/src/card/makeCard.ts b/app/src/card/makeCard.ts index 8219dc478..858b2efee 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 c192e49dc..38affbddb 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")}
`; diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index da049c619..b20f1c1fb 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); });