Skip to content

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

:art: 改进导入 Markdown 时 `<img>` 标签的处理 Fix https://github.com/siyuan-note/siyuan/issues/6480

Liang Ding8e8940c1b798
diff --git a/kernel/model/import.go b/kernel/model/import.go
index 2154d2c911..279d397018 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -657,8 +657,12 @@ func imgHtmlBlock2InlineImg(tree *parse.Tree) {
if 1 > len(htmlNodes) {
return ast.WalkContinue
}
- if atom.Img == htmlNodes[0].DataAtom {
- imgHtmlBlocks[n] = htmlNodes[0]
+
+ for _, htmlNode := range htmlNodes {
+ if atom.Img == htmlNode.DataAtom {
+ imgHtmlBlocks[n] = htmlNode
+ break
+ }
}
}
return ast.WalkContinue