mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
🎨 Parse <img> tags when pasting https://github.com/siyuan-note/siyuan/issues/15464
This commit is contained in:
parent
752457b888
commit
8934856d75
1 changed files with 8 additions and 0 deletions
|
|
@ -1382,6 +1382,14 @@ func htmlBlock2Inline(tree *parse.Tree) {
|
|||
ial := &ast.Node{Type: ast.NodeKramdownSpanIAL, Tokens: parse.IAL2Tokens([][]string{{"style", style}})}
|
||||
img.SetIALAttr("style", style)
|
||||
img.InsertAfter(ial)
|
||||
} else if height := domAttrValue(htmlImg, "height"); "" != height {
|
||||
if util2.IsDigit(height) {
|
||||
height += "px"
|
||||
}
|
||||
style := "height: " + height + ";"
|
||||
ial := &ast.Node{Type: ast.NodeKramdownSpanIAL, Tokens: parse.IAL2Tokens([][]string{{"style", style}})}
|
||||
img.SetIALAttr("style", style)
|
||||
img.InsertAfter(ial)
|
||||
}
|
||||
|
||||
if nil != n.Parent && ast.NodeText == n.Type {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue