🎨 浏览器剪藏扩展转义 Markdown 标记符 Fix https://github.com/siyuan-note/siyuan/issues/6348

This commit is contained in:
Liang Ding 2022-10-25 20:17:22 +08:00
parent 2f54fc0b8a
commit 92e4df2483
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 7 additions and 13 deletions

File diff suppressed because one or more lines are too long

View file

@ -68,15 +68,7 @@ func extensionCopy(c *gin.Context) {
return ast.WalkContinue
}
// 浏览器剪藏扩展改进 https://github.com/siyuan-note/siyuan/issues/6124
if ast.NodeInlineMath == n.Type {
// $ 转义
text := &ast.Node{Type: ast.NodeText}
text.Tokens = []byte("\\$" + string(n.ChildByType(ast.NodeInlineMathContent).Tokens) + "\\$")
n.InsertBefore(text)
unlinks = append(unlinks, n)
return ast.WalkSkipChildren
} else if ast.NodeText == n.Type {
if ast.NodeText == n.Type {
// 剔除行首空白
if ast.NodeParagraph == n.Parent.Type && n.Parent.FirstChild == n {
n.Tokens = bytes.TrimLeft(n.Tokens, " \t\n")

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.20221021091528-70e533d91a88
github.com/88250/lute v1.7.5-0.20221022153730-92ba7f9ffcb9
github.com/88250/lute v1.7.5-0.20221025110546-319a4ded6c94
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

View file

@ -19,6 +19,8 @@ github.com/88250/gulu v1.2.3-0.20221021091528-70e533d91a88 h1:Ax1/qJEF0Ipc2FtgHJ
github.com/88250/gulu v1.2.3-0.20221021091528-70e533d91a88/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20221022153730-92ba7f9ffcb9 h1:ATtPDhZ7/DbbdU+DyKTMiCSBdk00MYD/46i/eAUbE/8=
github.com/88250/lute v1.7.5-0.20221022153730-92ba7f9ffcb9/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221025110546-319a4ded6c94 h1:mi9O3bjQjUKmsFS79l6eviXwrBXQKVowp5j/Dg5AOqc=
github.com/88250/lute v1.7.5-0.20221025110546-319a4ded6c94/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=