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

This commit is contained in:
Liang Ding 2022-09-08 20:49:55 +08:00
parent 04d003c134
commit 7c5e3d042a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -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)
}
}