mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
🎨 浏览器剪藏扩展转义 Markdown 标记符 Fix https://github.com/siyuan-note/siyuan/issues/6348
This commit is contained in:
parent
2f54fc0b8a
commit
92e4df2483
4 changed files with 7 additions and 13 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue