mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 导出 PDF 支持保留折叠状态 https://github.com/siyuan-note/siyuan/issues/5941
This commit is contained in:
parent
2c2bd2a379
commit
11a580916c
7 changed files with 24 additions and 12 deletions
|
|
@ -194,7 +194,7 @@ func exportPreviewHTML(c *gin.Context) {
|
|||
|
||||
id := arg["id"].(string)
|
||||
tpl := arg["tpl"].(string)
|
||||
name, content := model.ExportHTML(id, "", true)
|
||||
name, content := model.ExportHTML(id, "", true, false)
|
||||
// 导出 PDF 预览时点击块引转换后的脚注跳转不正确 https://github.com/siyuan-note/siyuan/issues/5894
|
||||
content = strings.ReplaceAll(content, "http://127.0.0.1:"+util.ServerPort+"/#", "#")
|
||||
tpl = strings.ReplaceAll(tpl, "{tpl.name}", name)
|
||||
|
|
@ -235,7 +235,11 @@ func exportHTML(c *gin.Context) {
|
|||
id := arg["id"].(string)
|
||||
pdf := arg["pdf"].(bool)
|
||||
savePath := arg["savePath"].(string)
|
||||
name, content := model.ExportHTML(id, savePath, pdf)
|
||||
keepFold := false
|
||||
if arg["keepFold"] != nil {
|
||||
keepFold = arg["keepFold"].(bool)
|
||||
}
|
||||
name, content := model.ExportHTML(id, savePath, pdf, keepFold)
|
||||
ret.Data = map[string]interface{}{
|
||||
"id": id,
|
||||
"name": name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue