mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
This commit is contained in:
parent
4c91c92011
commit
bb1a4b4119
1 changed files with 3 additions and 2 deletions
|
|
@ -263,6 +263,7 @@ const promiseTransaction = () => {
|
|||
|
||||
const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
|
||||
let updatedEmbed = false;
|
||||
let html = operation.data;
|
||||
const updateEmbedElements = Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-type="NodeBlockQueryEmbed"] [data-node-id="${operation.id}"]`))
|
||||
if (updateEmbedElements.length === 0) {
|
||||
const tempElement = document.createElement("template");
|
||||
|
|
@ -272,14 +273,14 @@ const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
|
|||
const newTempElement = tempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`)
|
||||
if (newTempElement) {
|
||||
updateEmbedElements.push(embedBlockItem.firstElementChild)
|
||||
operation.data = newTempElement.outerHTML
|
||||
html = newTempElement.outerHTML
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
updateEmbedElements.forEach((item) => {
|
||||
const tempElement = document.createElement("div");
|
||||
tempElement.innerHTML = operation.data;
|
||||
tempElement.innerHTML = html;
|
||||
tempElement.querySelectorAll('[contenteditable="true"]').forEach(editItem => {
|
||||
editItem.setAttribute("contenteditable", "false");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue