Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17614

Daniel2de2590e8c02
diff --git a/kernel/model/import.go b/kernel/model/import.go
index 3f95495814..4e08909cd5 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -1448,7 +1448,15 @@ func htmlBlock2Inline(tree *parse.Tree) {
for n, htmlA := range aHtmlBlocks {
href := domAttrValue(htmlA, "href")
title := domAttrValue(htmlA, "title")
- anchor := util2.DomText(htmlA)
+ anchor := strings.TrimSpace(util2.DomText(htmlA))
+
+ if "" == anchor {
+ unlinks = append(unlinks, n)
+ if nil != n.Next && ast.NodeText == n.Next.Type && "</a>" == n.NextNodeText() {
+ unlinks = append(unlinks, n.Next)
+ }
+ continue
+ }
p := treenode.NewParagraph(n.ID)
a := &ast.Node{Type: ast.NodeLink}