🐛 导出模板无法保留第一个空段落 Fix https://github.com/siyuan-note/siyuan/issues/7411

This commit is contained in:
Liang Ding 2023-02-20 11:07:51 +08:00
parent 41f3b146d0
commit c778558abd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "./h
import * as dayjs from "dayjs";
import {transaction, updateTransaction} from "../wysiwyg/transaction";
import {getContenteditableElement} from "../wysiwyg/getBlock";
import {focusBlock, getEditorRange, focusByWbr, fixTableRange} from "./selection";
import {fixTableRange, focusBlock, focusByWbr, getEditorRange} from "./selection";
import {mathRender} from "../markdown/mathRender";
import {Constants} from "../../constants";
import {highlightRender} from "../markdown/highlightRender";
@ -75,7 +75,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false) =>
});
}
const tempElement = document.createElement("template");
// 老板说不论什么情况都需要再 spin 一次 https://github.com/siyuan-note/siyuan/issues/7118
// 需要再 spin 一次 https://github.com/siyuan-note/siyuan/issues/7118
tempElement.innerHTML = protyle.lute.SpinBlockDOM(html);
const editableElement = getContenteditableElement(blockElement);
// 使用 lute 方法会添加 p 元素,只有一个 p 元素或者只有一个字符串或者为 <u>b</u> 时的时候只拷贝内部