mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 改进导入 Markdown 时 <img> 标签的处理 Fix https://github.com/siyuan-note/siyuan/issues/5501
This commit is contained in:
parent
a7b43cbd22
commit
be2913c956
2 changed files with 64 additions and 2 deletions
|
|
@ -570,8 +570,7 @@ func buildSpanFromNode(n *ast.Node, tree *parse.Tree, rootID, boxID, p string) (
|
|||
spans = append(spans, tags...)
|
||||
}
|
||||
case ast.NodeInlineHTML, ast.NodeHTMLBlock, ast.NodeIFrame, ast.NodeWidget, ast.NodeAudio, ast.NodeVideo:
|
||||
htmlRoot := &html.Node{Type: html.ElementNode}
|
||||
nodes, err := html.ParseFragment(strings.NewReader(gulu.Str.FromBytes(n.Tokens)), htmlRoot)
|
||||
nodes, err := html.ParseFragment(bytes.NewReader(n.Tokens), &html.Node{Type: html.ElementNode})
|
||||
if nil != err {
|
||||
logging.LogErrorf("parse HTML failed: %s", err)
|
||||
walkStatus = ast.WalkContinue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue