🐛 导出模板无法保留第一个空段落 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> 时的时候只拷贝内部

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/css v0.1.2
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798
github.com/88250/lute v1.7.6-0.20230218053657-5e19a7237c01
github.com/88250/lute v1.7.6-0.20230220030205-b0f64d7ba66e
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20230216061320-bccdb98581a3

View File

@ -8,8 +8,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798 h1:sR/s/Y9wyl79ZRCUERwLPo9zqaB3KhNRodCMTJ4ozEU=
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.6-0.20230218053657-5e19a7237c01 h1:kbngnxdiQ9Bbvc6cv1Hmj5kH230e0453lhd8pkNmpjA=
github.com/88250/lute v1.7.6-0.20230218053657-5e19a7237c01/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.6-0.20230220030205-b0f64d7ba66e h1:7UgFzsksh+z6IX2z+BKG3tt1TU7LJNb0zOHDbhLEaUc=
github.com/88250/lute v1.7.6-0.20230220030205-b0f64d7ba66e/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=