Skip to content

Commit

Permalink
🎨 Improve HTML clipping siyuan-note/siyuan#12725
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 8, 2024
1 parent 3db6018 commit 82d460d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions h2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,17 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {
}
}

if lute.ParseOptions.ProtyleWYSIWYG {
node.Tokens = lex.EscapeProtyleMarkers(node.Tokens)
if nil != n.Parent && atom.Span == n.Parent.DataAtom && 0 == len(n.Parent.Attr) {
// 按原文解析,不处理转义
} else {
if nil != n.Parent && atom.Span == n.Parent.DataAtom && 0 == len(n.Parent.Attr) {
// 按原文解析,不处理转义
if lute.ParseOptions.ProtyleWYSIWYG {
node.Tokens = lex.EscapeProtyleMarkers(node.Tokens)
} else {
node.Tokens = lex.EscapeCommonMarkers(node.Tokens)
}
if lute.parentIs(n, atom.Table) {
node.Tokens = bytes.ReplaceAll(node.Tokens, []byte("\\|"), []byte("|"))
node.Tokens = bytes.ReplaceAll(node.Tokens, []byte("|"), []byte("\\|"))
if lute.parentIs(n, atom.Table) {
node.Tokens = bytes.ReplaceAll(node.Tokens, []byte("\\|"), []byte("|"))
node.Tokens = bytes.ReplaceAll(node.Tokens, []byte("|"), []byte("\\|"))
}
}
}

Expand Down

0 comments on commit 82d460d

Please sign in to comment.