Browse Source

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

Liang Ding 2 years ago
parent
commit
e71c120a97

+ 1 - 1
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",

+ 1 - 1
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",

+ 1 - 1
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",

+ 1 - 1
app/appearance/langs/zh_CHT.json

@@ -459,7 +459,7 @@
   "newNameFile": "新建文檔名為",
   "newContentFile": "新建文檔內容為",
   "exporting": "正在匯出,請稍等...",
-  "exported": "匯出完成",
+  "exported": "匯出完成",
   "refExpired": "不存在符合條件的內容塊",
   "emptyContent": "暫無相關內容",
   "useBrowserView": "在瀏覽器中查看",

+ 1 - 1
app/appearance/langs/zh_CN.json

@@ -459,7 +459,7 @@
   "newNameFile": "新建文档名为",
   "newContentFile": "新建文档内容为",
   "exporting": "正在导出,请稍等...",
-  "exported": "导出完成",
+  "exported": "导出完成",
   "refExpired": "不存在符合条件的内容块",
   "emptyContent": "暂无相关内容",
   "useBrowserView": "在浏览器中查看",

+ 1 - 1
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", () => {

+ 6 - 2
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,