An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve markdown importing https://github.com/siyuan-note/siyuan/issues/13080
Danielc5dc86bf8e75
diff --git a/kernel/model/import.go b/kernel/model/import.goindex 2b65d24261..de0d3513f9 100644--- a/kernel/model/import.go+++ b/kernel/model/import.go@@ -1102,7 +1102,7 @@ func imgHtmlBlock2InlineImg(tree *parse.Tree) {return ast.WalkContinue}- if ast.NodeHTMLBlock == n.Type {+ if ast.NodeHTMLBlock == n.Type || (ast.NodeText == n.Type && bytes.HasPrefix(bytes.ToLower(n.Tokens), []byte("<img "))) {tokens := bytes.TrimSpace(n.Tokens)if bytes.HasPrefix(tokens, []byte("<div>")) {tokens = bytes.TrimPrefix(tokens, []byte("<div>"))@@ -1151,7 +1151,12 @@ func imgHtmlBlock2InlineImg(tree *parse.Tree) {}img.AppendChild(&ast.Node{Type: ast.NodeCloseParen})- n.InsertBefore(p)+ if nil != n.Parent && ast.NodeText == n.Type {+ // 行级 HTML 会被解析为文本,所以这里要在父级段落前面插入,避免形成段落嵌套 https://github.com/siyuan-note/siyuan/issues/13080+ n.Parent.InsertBefore(p)+ } else {+ n.InsertBefore(p)+ }n.Unlink()}return