🎨 No longer add the id attribute to block elements after setting the attribute https://github.com/siyuan-note/siyuan/issues/15327

This commit is contained in:
Daniel 2025-07-18 18:35:46 +08:00
parent f28ccd64b5
commit 0394521e1f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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";