Skip to content

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

:art: 支持合并子文档导出 Word/PDF https://github.com/siyuan-note/siyuan/issues/3219

Liang Dinge71c120a9762
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index ceef89e394..41a0352903 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -459,7 +459,7 @@
"newNameFile": "The name of the new document is",
"newContentFile": "The content of the new document is",
"exporting": "Exporting, please wait...",
- "exported": "Export complete: ",
+ "exported": "Export complete",
"refExpired": "Search content block does not exist",
"emptyContent": "No related content",
"useBrowserView": "View in the browser",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 2110493afc..137a02e4ce 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -458,7 +458,7 @@
"newNameFile": "El nombre del nuevo documento es",
"newContentFile": "El contenido del nuevo documento es",
"exporting": "Exportando, por favor espere...",
- "exported": "Exportación completada: ",
+ "exported": "Exportación completada",
"refExpired": "El bloque de contenido de búsqueda no existe",
"emptyContent": "No hay contenido relacionado",
"useBrowserView": "Ver en el navegador",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 7b8e416713..d881cc0b63 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -459,7 +459,7 @@
"newNameFile": "Le nom du nouveau document est",
"newContentFile": "Le contenu du nouveau document est",
"exporting": "En cours d'exportation, veuillez patienter...",
- "exported": "Exportation terminée: ",
+ "exported": "Exportation terminée",
"refExpired": "Le bloc de contenu de recherche n'existe pas",
"emptyContent": "Aucun contenu pertinent pour le moment",
"useBrowserView": "Afficher dans le navigateur",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index 38951d1fad..4d2ff6d99d 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -459,7 +459,7 @@
"newNameFile": "新建文檔名為",
"newContentFile": "新建文檔內容為",
"exporting": "正在匯出,請稍等...",
- "exported": "匯出完成:",
+ "exported": "匯出完成",
"refExpired": "不存在符合條件的內容塊",
"emptyContent": "暫無相關內容",
"useBrowserView": "在瀏覽器中查看",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 55773d451e..36cc7ccab7 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -459,7 +459,7 @@
"newNameFile": "新建文档名为",
"newContentFile": "新建文档内容为",
"exporting": "正在导出,请稍等...",
- "exported": "导出完成:",
+ "exported": "导出完成",
"refExpired": "不存在符合条件的内容块",
"emptyContent": "暂无相关内容",
"useBrowserView": "在浏览器中查看",
diff --git a/app/src/protyle/export/util.ts b/app/src/protyle/export/util.ts
index 935bb92ef7..69e264a83f 100644
--- a/app/src/protyle/export/util.ts
+++ b/app/src/protyle/export/util.ts
@@ -15,7 +15,7 @@ import {openByMobile} from "../util/compatibility";
export const afterExport = (exportPath: string, msgId: string) => {
/// #if !BROWSER
- showMessage(`${window.siyuan.languages.exported}${escapeHtml(exportPath)}
+ showMessage(`${window.siyuan.languages.exported} ${escapeHtml(exportPath)}
<div class="fn__space"></div>
<button class="b3-button b3-button--white">${window.siyuan.languages.showInFolder}</button>`, 6000, "info", msgId);
document.querySelector(`#message [data-id="${msgId}"] button`).addEventListener("click", () => {
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 35910b8b99..debfedbcc9 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -504,8 +504,12 @@ func AddPDFOutline(id, p string) (err error) {
footnotes := map[string]*pdfcpu.Bookmark{}
for _, link := range links {
linkID := link.URI[strings.LastIndex(link.URI, "/")+1:]
-
- title := sql.GetBlock(linkID).Content
+ b := sql.GetBlock(linkID)
+ if nil == b {
+ logging.LogWarnf("pdf outline block [%s] not found", linkID)
+ continue
+ }
+ title := b.Content
title, _ = url.QueryUnescape(title)
bm := &pdfcpu.Bookmark{
Title: title,