Skip to content

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

:art: Improve the handling of inline-math containing `|` in the table https://github.com/siyuan-note/siyuan/issues/9227

Daniel4ed3efd7dd82
diff --git a/app/stage/protyle/js/lute/lute.min.js b/app/stage/protyle/js/lute/lute.min.js
index 1f26e1e82d..6d0317c6ae 100644
--- a/app/stage/protyle/js/lute/lute.min.js
+++ b/app/stage/protyle/js/lute/lute.min.js
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:12031aad4d13b869024424e0ce2b444fc59e872b6e644f2e378248de3787d7c5
-size 3784841
+oid sha256:e55c0f0c6a57879417c68d8b93e610cdd4107080c9d083f035f396bb24eb5fa2
+size 3784113
diff --git a/kernel/model/template.go b/kernel/model/template.go
index 2e2cf6d9a9..3881f027f9 100644
--- a/kernel/model/template.go
+++ b/kernel/model/template.go
@@ -271,6 +271,11 @@ func renderTemplate(p, id string) (string, error) {
unlinks = append(unlinks, n)
}
}
+ } else if n.IsTextMarkType("inline-math") {
+ if n.ParentIs(ast.NodeTableCell) {
+ // 表格中的公式中带有管道符时使用 HTML 实体替换管道符 Improve the handling of inline-math containing `|` in the table https://github.com/siyuan-note/siyuan/issues/9227
+ n.TextMarkInlineMathContent = strings.ReplaceAll(n.TextMarkInlineMathContent, "|", "|")
+ }
}
return ast.WalkContinue
})