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: Formula parsing supports $ followed by numbers when importing Markdown https://github.com/siyuan-note/siyuan/issues/8362
Daniela3d2e89a657d
diff --git a/kernel/model/import.go b/kernel/model/import.goindex 24ad4b4e78..acc8e0a886 100644--- a/kernel/model/import.go+++ b/kernel/model/import.go@@ -38,7 +38,6 @@ import ("time""github.com/88250/gulu"- "github.com/88250/lute""github.com/88250/lute/ast""github.com/88250/lute/html""github.com/88250/lute/html/atom"@@ -712,17 +711,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {}func parseStdMd(markdown []byte) (ret *parse.Tree) {- luteEngine := lute.New()- luteEngine.SetFootnotes(false)- luteEngine.SetToC(false)- luteEngine.SetIndentCodeBlock(false)- luteEngine.SetAutoSpace(false)- luteEngine.SetHeadingID(false)- luteEngine.SetSetext(false)- luteEngine.SetYamlFrontMatter(false)- luteEngine.SetLinkRef(false)- luteEngine.SetGFMAutoLink(false) // 导入 Markdown 时不自动转换超链接 https://github.com/siyuan-note/siyuan/issues/7682- luteEngine.SetImgPathAllowSpace(true)+ luteEngine := util.NewStdLute()ret = parse.Parse("", markdown, luteEngine.ParseOptions)if nil == ret {returndiff --git a/kernel/util/lute.go b/kernel/util/lute.goindex 2caf8875ac..26aae3d9b1 100644--- a/kernel/util/lute.go+++ b/kernel/util/lute.go@@ -46,3 +46,19 @@ func NewLute() (ret *lute.Lute) {ret.SetSanitize(true)return}++func NewStdLute() (ret *lute.Lute) {+ ret = lute.New()+ ret.SetFootnotes(false)+ ret.SetToC(false)+ ret.SetIndentCodeBlock(false)+ ret.SetAutoSpace(false)+ ret.SetHeadingID(false)+ ret.SetSetext(false)+ ret.SetYamlFrontMatter(false)+ ret.SetLinkRef(false)+ ret.SetGFMAutoLink(false) // 导入 Markdown 时不自动转换超链接 https://github.com/siyuan-note/siyuan/issues/7682+ ret.SetImgPathAllowSpace(true)+ ret.SetInlineMathAllowDigitAfterOpenMarker(true) // Formula parsing supports $ followed by numbers when importing Markdown https://github.com/siyuan-note/siyuan/issues/8362+ return+}