mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
This commit is contained in:
parent
6d3b7777ac
commit
0ebd5d6d75
1 changed files with 15 additions and 1 deletions
|
|
@ -263,7 +263,21 @@ const promiseTransaction = () => {
|
|||
|
||||
const updateEmbed = (protyle: IProtyle, operation: IOperation) => {
|
||||
let updatedEmbed = false;
|
||||
protyle.wysiwyg.element.querySelectorAll(`[data-type="NodeBlockQueryEmbed"] [data-node-id="${operation.id}"]`).forEach((item) => {
|
||||
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");
|
||||
tempElement.innerHTML = operation.data;
|
||||
protyle.wysiwyg.element.querySelectorAll('[data-type="NodeBlockQueryEmbed"]').forEach((item) => {
|
||||
item.querySelectorAll(`.protyle-wysiwyg__embed`).forEach(embedBlockItem => {
|
||||
const newTempElement = tempElement.content.querySelector(`[data-node-id="${embedBlockItem.getAttribute("data-id")}"]`)
|
||||
if (newTempElement) {
|
||||
updateEmbedElements.push(embedBlockItem.firstElementChild)
|
||||
operation.data = newTempElement.outerHTML
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
updateEmbedElements.forEach((item) => {
|
||||
const tempElement = document.createElement("div");
|
||||
tempElement.innerHTML = operation.data;
|
||||
tempElement.querySelectorAll('[contenteditable="true"]').forEach(editItem => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue