mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
This commit is contained in:
parent
192db4f306
commit
690dcb5899
2 changed files with 8 additions and 22 deletions
|
|
@ -450,26 +450,6 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
|||
if (tempElement.content.firstChild.nodeType === 3 || (tempElement.content.firstChild.nodeType === 1 && tempElement.content.firstElementChild.tagName !== "DIV")) {
|
||||
tempElement.innerHTML = protyle.lute.SpinBlockDOM(tempElement.innerHTML);
|
||||
}
|
||||
// let foldHeadingId = "";
|
||||
// let foldHTML = "";
|
||||
// 粘贴内容中包含折叠的子节点需后端插入到原节点中
|
||||
// Array.from(tempElement.content.children).forEach((item) => {
|
||||
// if (!item.getAttribute("parent-heading") && foldHeadingId && foldHTML) {
|
||||
// fetchPost("/api/block/appendHeadingChildren", {id: foldHeadingId, dom: foldHTML});
|
||||
// foldHeadingId = "";
|
||||
// foldHTML = "";
|
||||
// }
|
||||
// if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
|
||||
// foldHeadingId = item.getAttribute("data-node-id");
|
||||
// return true;
|
||||
// }
|
||||
// if (foldHeadingId && item.getAttribute("parent-heading")) {
|
||||
// foldHTML += item.outerHTML;
|
||||
// }
|
||||
// });
|
||||
// if (foldHeadingId && foldHTML) {
|
||||
// fetchPost("/api/block/appendHeadingChildren", {id: foldHeadingId, dom: foldHTML});
|
||||
// }
|
||||
(insertBefore ? Array.from(tempElement.content.children) : Array.from(tempElement.content.children).reverse()).find((item) => {
|
||||
let addId = item.getAttribute("data-node-id");
|
||||
const hasParentHeading = item.getAttribute("parent-heading");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue