mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
030fa52c73
commit
e551cb4a4c
1 changed files with 12 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import {fetchPost} from "../../util/fetch";
|
|||
import {isIncludeCell} from "./table";
|
||||
import {getFieldIdByCellElement} from "../render/av/row";
|
||||
import {processClonePHElement} from "../render/util";
|
||||
import {setFold} from "../../menus/protyle";
|
||||
|
||||
const processAV = (range: Range, html: string, protyle: IProtyle, blockElement: HTMLElement) => {
|
||||
const tempElement = document.createElement("template");
|
||||
|
|
@ -556,6 +557,17 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
|||
if (wbrElement) {
|
||||
wbrElement.remove();
|
||||
}
|
||||
let foldData;
|
||||
if (blockElement.getAttribute("data-type") === "NodeHeading" &&
|
||||
blockElement.getAttribute("fold") === "1") {
|
||||
foldData = setFold(protyle, blockElement, true, false, false, true);
|
||||
doOperation.reverse();
|
||||
foldData.doOperations[0].context = {
|
||||
focusId: lastElement?.getAttribute("data-node-id"),
|
||||
};
|
||||
doOperation.push(...foldData.doOperations);
|
||||
undoOperation.push(...foldData.undoOperations);
|
||||
}
|
||||
transaction(protyle, doOperation, undoOperation);
|
||||
// 复制容器块中包含折叠标题块
|
||||
protyle.wysiwyg.element.querySelectorAll("[parent-heading]").forEach(item => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue