Skip to content

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

:art: Improve find-replace of image/link elements https://github.com/siyuan-note/siyuan/issues/14049

Danieldbbd250894fd
diff --git a/kernel/model/search.go b/kernel/model/search.go
index 3a47a698dc..eb261fd082 100644
--- a/kernel/model/search.go
+++ b/kernel/model/search.go
@@ -688,7 +688,12 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
}
if "" == n.TextMarkAHref {
- unlinks = append(unlinks, n)
+ if "" == n.TextMarkTextContent {
+ unlinks = append(unlinks, n)
+ } else {
+ n.Type = ast.NodeText
+ n.Tokens = []byte(n.TextMarkTextContent)
+ }
}
}
} else if n.IsTextMarkType("em") {