Skip to content

Commit 0394521

Browse files
committed
🎨 No longer add the id attribute to block elements after setting the attribute #15327
1 parent f28ccd6 commit 0394521

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/src/protyle/wysiwyg/transaction.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,11 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
607607
data.new.style += ";animation:addCard 450ms linear";
608608
}
609609
Object.keys(data.new).forEach(key => {
610+
if ("id" === key) {
611+
// 设置属性以后不应该给块元素添加 id 属性 No longer add the `id` attribute to block elements after setting the attribute https://github.com/siyuan-note/siyuan/issues/15327
612+
return;
613+
}
614+
610615
item.setAttribute(key, data.new[key]);
611616
if (key === Constants.CUSTOM_RIFF_DECKS && data.new[Constants.CUSTOM_RIFF_DECKS] !== data.old[Constants.CUSTOM_RIFF_DECKS]) {
612617
item.style.animation = "addCard 450ms linear";

0 commit comments

Comments
 (0)