mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-18 10:00:48 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9d9f222f76
@ -195,6 +195,8 @@ func exportPreviewHTML(c *gin.Context) {
|
|||||||
id := arg["id"].(string)
|
id := arg["id"].(string)
|
||||||
tpl := arg["tpl"].(string)
|
tpl := arg["tpl"].(string)
|
||||||
name, content := model.ExportHTML(id, "", true)
|
name, content := model.ExportHTML(id, "", true)
|
||||||
|
// 导出 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)
|
tpl = strings.ReplaceAll(tpl, "{tpl.name}", name)
|
||||||
tpl = strings.ReplaceAll(tpl, "{tpl.content}", content)
|
tpl = strings.ReplaceAll(tpl, "{tpl.content}", content)
|
||||||
tmpName := gulu.Rand.String(7)
|
tmpName := gulu.Rand.String(7)
|
||||||
@ -213,7 +215,7 @@ func exportPreviewHTML(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
url := path.Join("http://127.0.0.1:6806", "export", "preview", tmpName)
|
url := path.Join("http://127.0.0.1:"+util.ServerPort, "export", "preview", tmpName)
|
||||||
ret.Data = map[string]interface{}{
|
ret.Data = map[string]interface{}{
|
||||||
"id": id,
|
"id": id,
|
||||||
"name": name,
|
"name": name,
|
||||||
|
Loading…
Reference in New Issue
Block a user