An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Fix https://github.com/siyuan-note/siyuan/issues/17138
Daniel3d5c24519b25
diff --git a/kernel/api/extension.go b/kernel/api/extension.goindex e8b2c29932..693aff3aee 100644--- a/kernel/api/extension.go+++ b/kernel/api/extension.go@@ -224,13 +224,6 @@ func extensionCopy(c *gin.Context) {})tree, withMath = model.HTML2Tree(dom, luteEngine)- if nil == tree {- md, withMath, _ = model.HTML2Markdown(dom, luteEngine)- if withMath {- luteEngine.SetInlineMath(true)- }- tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)- }} else {tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)}diff --git a/kernel/api/lute.go b/kernel/api/lute.goindex 6381bb4853..4bcecb1f34 100644--- a/kernel/api/lute.go+++ b/kernel/api/lute.go@@ -23,6 +23,7 @@ import ("strings""github.com/88250/gulu"+ "github.com/88250/lute""github.com/88250/lute/ast""github.com/88250/lute/parse""github.com/88250/lute/render"@@ -81,13 +82,6 @@ func html2BlockDOM(c *gin.Context) {luteEngine.SetHTMLTag2TextMark(true)luteEngine.SetHTML2MarkdownAttrs([]string{"alias", "memo", "bookmark", "custom-*"})tree, _ := model.HTML2Tree(dom, luteEngine)- if nil == tree {- md, withMath, _ := model.HTML2Markdown(dom, luteEngine)- if withMath {- luteEngine.SetInlineMath(true)- }- tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)- }if nil == tree {ret.Data = "Failed to convert"return@@ -191,6 +185,13 @@ func html2BlockDOM(c *gin.Context) {parse.TextMarks2Inlines(tree) // 先将 TextMark 转换为 Inlines https://github.com/siyuan-note/siyuan/issues/13056parse.NestedInlines2FlattedSpansHybrid(tree, false)+ md, err := lute.FormatNodeSync(tree.Root, luteEngine.ParseOptions, luteEngine.RenderOptions)+ if nil != err {+ ret.Data = "Failed to convert"+ return+ }++ tree = parse.Parse("", []byte(md), luteEngine.ParseOptions)renderer := render.NewProtyleRenderer(tree, luteEngine.RenderOptions, luteEngine.ParseOptions)output := renderer.Render()ret.Data = gulu.Str.FromBytes(output)