Skip to content

Commit

Permalink
🎨 Improve HTML code block clipping siyuan-note/siyuan#12014
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Jul 30, 2024
1 parent a306818 commit 2023667
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions h2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ func (lute *Lute) genASTByDOM(n *html.Node, tree *parse.Tree) {
}
}

if atom.P == firstc.DataAtom {
// 避免下面 util.DomText 把 p 转换为两个换行
firstc.DataAtom = atom.Div
}

buf := &bytes.Buffer{}
buf.WriteString(util.DomText(n))
tokens := buf.Bytes()
Expand Down
Loading

0 comments on commit 2023667

Please sign in to comment.