diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 8bd7d4e6d..9d4afa3b7 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -607,6 +607,11 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: data.new.style += ";animation:addCard 450ms linear"; } Object.keys(data.new).forEach(key => { + if ("id" === key) { + // 设置属性以后不应该给块元素添加 id 属性 No longer add the `id` attribute to block elements after setting the attribute https://github.com/siyuan-note/siyuan/issues/15327 + return; + } + item.setAttribute(key, data.new[key]); if (key === Constants.CUSTOM_RIFF_DECKS && data.new[Constants.CUSTOM_RIFF_DECKS] !== data.old[Constants.CUSTOM_RIFF_DECKS]) { item.style.animation = "addCard 450ms linear";