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 HTML svg clipping https://github.com/siyuan-note/siyuan/issues/16413
Danielc8033c44b0c9
diff --git a/kernel/model/import.go b/kernel/model/import.goindex 0b4983ffd8..8563f05d24 100644--- a/kernel/model/import.go+++ b/kernel/model/import.go@@ -78,6 +78,27 @@ func HTML2Tree(htmlStr string, luteEngine *lute.Lute) (tree *parse.Tree, withMatreturn ast.WalkContinue}+ if ast.NodeHTMLBlock == n.Type {+ if bytes.HasPrefix(n.Tokens, []byte("<pre ")) && bytes.HasSuffix(n.Tokens, []byte("</pre>")) && bytes.Contains(n.Tokens, []byte("data:image/svg+xml;base64")) {+ matches := regexp.MustCompile(`(?sU)<pre [^>]*>(.*)</pre>`).FindSubmatch(n.Tokens)+ if len(matches) >= 2 {+ n.Tokens = matches[1]+ }+ subTree := parse.Inline("", n.Tokens, luteEngine.ParseOptions)+ if nil != subTree && nil != subTree.Root && nil != subTree.Root.FirstChild {+ n.Type = ast.NodeParagraph+ var children []*ast.Node+ for c := subTree.Root.FirstChild.FirstChild; nil != c; c = c.Next {+ children = append(children, c)+ }+ for _, c := range children {+ n.AppendChild(c)+ }+ }+ }+ return ast.WalkContinue+ }+if ast.NodeText == n.Type {if n.ParentIs(ast.NodeTableCell) {n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("\\|"), []byte("|"))