🐛 行级元素键盘和下划线无法粘贴为纯文本 Fix https://github.com/siyuan-note/siyuan/issues/6220
This commit is contained in:
parent
1bc9c37602
commit
49fd4bc1d0
4 changed files with 9 additions and 2 deletions
|
@ -50,7 +50,10 @@ export const pasteAsPlainText = async (protyle:IProtyle) => {
|
|||
uploadLocalFiles(localFiles, protyle, false);
|
||||
writeText("");
|
||||
} else {
|
||||
insertHTML(protyle.lute.BlockDOM2Content(protyle.lute.InlineMd2BlockDOM(clipboard.readText())), protyle, false);
|
||||
protyle.lute.SetHTMLTag2TextMark(true); // 临时设置 Lute 解析参数,行级元素键盘和下划线无法粘贴为纯文本 https://github.com/siyuan-note/siyuan/issues/6220
|
||||
const dom = protyle.lute.InlineMd2BlockDOM(clipboard.readText())
|
||||
protyle.lute.SetHTMLTag2TextMark(false);
|
||||
insertHTML(protyle.lute.BlockDOM2Content(dom), protyle, false);
|
||||
}
|
||||
/// #endif
|
||||
};
|
||||
|
|
2
app/src/types/protyle.d.ts
vendored
2
app/src/types/protyle.d.ts
vendored
|
@ -215,6 +215,8 @@ declare class Lute {
|
|||
|
||||
public SetProtyleWYSIWYG(wysiwyg: boolean): void;
|
||||
|
||||
public SetHTMLTag2TextMark(enable: boolean): void;
|
||||
|
||||
public MarkdownStr(name: string, md: string): string;
|
||||
|
||||
public IsValidLinkDest(text: string): boolean;
|
||||
|
|
|
@ -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.20221007162906-ded80d955178
|
||||
github.com/88250/lute v1.7.5-0.20221016085051-6aa1872a112b
|
||||
github.com/88250/lute v1.7.5-0.20221016091231-5b3f92fac78a
|
||||
github.com/88250/pdfcpu v0.3.13
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732
|
||||
|
|
|
@ -23,6 +23,8 @@ github.com/88250/lute v1.7.5-0.20221016061849-db5f26667c4f h1:D2cCQIpNBWc6jE+OCe
|
|||
github.com/88250/lute v1.7.5-0.20221016061849-db5f26667c4f/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
|
||||
github.com/88250/lute v1.7.5-0.20221016085051-6aa1872a112b h1:FUlWKJ9eK5XY6NBpEnAyc3Sb5Xp62wCQyM/K3KJpzZQ=
|
||||
github.com/88250/lute v1.7.5-0.20221016085051-6aa1872a112b/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
|
||||
github.com/88250/lute v1.7.5-0.20221016091231-5b3f92fac78a h1:KUtNpX01Dx2GOv9Da6IS2i2cX58ZK6RdFMn+XeQdfzs=
|
||||
github.com/88250/lute v1.7.5-0.20221016091231-5b3f92fac78a/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=
|
||||
|
|
Loading…
Add table
Reference in a new issue