From f4d230684a63346982e85903fb131689b0a89454 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 17 Sep 2022 10:46:11 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=AF=BC=E5=87=BA=20PDF=20=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=97=B6=E7=82=B9=E5=87=BB=E5=9D=97=E5=BC=95=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E7=9A=84=E8=84=9A=E6=B3=A8=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=20Fix=20https://github.com/siyuan-n?= =?UTF-8?q?ote/siyuan/issues/5894?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/api/export.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/api/export.go b/kernel/api/export.go index 68de07847..92353fa8b 100644 --- a/kernel/api/export.go +++ b/kernel/api/export.go @@ -195,6 +195,8 @@ func exportPreviewHTML(c *gin.Context) { id := arg["id"].(string) tpl := arg["tpl"].(string) 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.content}", content) tmpName := gulu.Rand.String(7) @@ -213,7 +215,7 @@ func exportPreviewHTML(c *gin.Context) { 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{}{ "id": id, "name": name,