mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🎨 Improve table parsing https://github.com/siyuan-note/siyuan/issues/11630
This commit is contained in:
parent
3a707fd884
commit
05585240f9
4 changed files with 12 additions and 5 deletions
|
|
@ -63,6 +63,13 @@ func HTML2Markdown(htmlStr string) (markdown string, withMath bool, err error) {
|
|||
return ast.WalkContinue
|
||||
}
|
||||
|
||||
if ast.NodeText == n.Type {
|
||||
if n.ParentIs(ast.NodeTableCell) {
|
||||
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("\\|"), []byte("|"))
|
||||
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("|"), []byte("\\|"))
|
||||
}
|
||||
}
|
||||
|
||||
if ast.NodeInlineMath == n.Type {
|
||||
withMath = true
|
||||
return ast.WalkContinue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue