Vanessa 2026-02-08 10:59:55 +08:00
parent 0e8432fd16
commit ec34ecac52
2 changed files with 31 additions and 36 deletions

View file

@ -188,7 +188,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
break;
}
const cellValue = textJSON[i][j];
const operations = await updateCellsValue(protyle, blockElement as HTMLElement, cellValue, [cellElement], columns, html, true);
const operations = await updateCellsValue(protyle, blockElement as HTMLElement, cellValue, [cellElement], columns, tempElement.content.children[i].outerHTML, true);
if (operations.doOperations.length > 0) {
doOperations.push(...operations.doOperations);
undoOperations.push(...operations.undoOperations);
@ -292,10 +292,13 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
return;
}
if (blockElement.classList.contains("av") && !isBlock) {
range.deleteContents();
processAV(range, html, protyle, blockElement as HTMLElement);
return;
if (blockElement.classList.contains("av")) {
const avTitleElement = hasClosestByClassName(range.startContainer, "av__title");
if (!avTitleElement || (avTitleElement && !isBlock)) {
range.deleteContents();
processAV(range, html, protyle, blockElement as HTMLElement);
return;
}
}
if (blockElement.classList.contains("table") && blockElement.querySelector(".table__select").clientWidth > 0 &&
processTable(range, html, protyle, blockElement)) {