Skip to content

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

:bug: 导出 PDF 插入文档标题转义问题

Liang Ding7c5e3d042a95
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 6745e2f36d..ea616aaee0 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -1288,7 +1288,8 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros bool) (ret *parse.T
if Conf.Export.AddTitle {
if root, _ := getBlock(id); nil != root {
title := &ast.Node{Type: ast.NodeHeading, HeadingLevel: 1}
- title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(root.Content)})
+ content := html.UnescapeString(root.Content)
+ title.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(content)})
ret.Root.PrependChild(title)
}
}