Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Parse `<img>` tags when pasting https://github.com/siyuan-note/siyuan/issues/15464

Daniel8934856d75b6
diff --git a/kernel/model/import.go b/kernel/model/import.go
index e00aac8163..7ead15023a 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -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 {