This commit is contained in:
Vanessa 2023-03-05 14:18:23 +08:00
parent 67014d2ada
commit 184949dd69
3 changed files with 25 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import {transaction, updateTransaction} from "../protyle/wysiwyg/transaction";
import {scrollCenter} from "../util/highlightById";
import {Constants} from "../constants";
import {hideElements} from "../protyle/ui/hideElements";
import {blockRender} from "../protyle/markdown/blockRender";
export const cancelSB = (protyle: IProtyle, nodeElement: Element) => {
const doOperations: IOperation[] = [];
@ -48,7 +49,14 @@ export const cancelSB = (protyle: IProtyle, nodeElement: Element) => {
});
previousId = item.getAttribute("data-node-id");
});
// 超级块内嵌入块无面包屑,需重新渲染 https://github.com/siyuan-note/siyuan/issues/7574
doOperations.forEach(item => {
const element = protyle.wysiwyg.element.querySelector(`[data-node-id="${item.id}"]`);
if (element && element.getAttribute("data-type") === "NodeBlockQueryEmbed") {
element.removeAttribute("data-render")
blockRender(protyle, element)
}
})
return {
doOperations, undoOperations, previousId
};