Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-10-25 09:34:49 +08:00
commit f340a163f1
8 changed files with 22 additions and 9 deletions

View file

@ -1089,7 +1089,7 @@
"6": "Create notebook [%s] folder [%s] failed: %s",
"7": "Remove notebook [%s] path [%s] failed: %s",
"8": "Check update failed",
"9": "A new version is available, please browse the release announcement %s",
"9": "\uD83D\uDE80 A new version is available, please browse the release announcement %s",
"10": "Is the latest version",
"11": "\uD83D\uDCE2 系統公告:<a target='_blank' href='%s'>%s</a>",
"12": "Query asset failed [%s]",

View file

@ -1089,7 +1089,7 @@
"6": "Crear cuaderno [%s] carpeta [%s] falló: %s",
"7": "Eliminar libreta [%s] ruta [%s] falló: %s",
"8": "Comprobar la actualización falló",
"9": "Una nueva versión está disponible, por favor, busque el anuncio de lanzamiento %s",
"9": "\uD83D\uDE80 Una nueva versión está disponible, por favor, busque el anuncio de lanzamiento %s",
"10": "Es la última versión",
"11": "\uD83D\uDCE2 Anuncio del sistema: <a target='_blank' href='%s'>%s</a>",
"12": "Fallo en la consulta de activos [%s]",

View file

@ -1089,7 +1089,7 @@
"6": "La création du dossier du carnet de notes [%s] dossier [%s] failed: %s",
"7": "La suppression du carnet de notes [%s] path [%s] a échoué : %s",
"8": "La vérification de la mise à jour a échoué",
"9": "Une nouvelle version est disponible, veuillez consulter l'annonce de la version %s",
"9": "\uD83D\uDE80 Une nouvelle version est disponible, veuillez consulter l'annonce de la version %s",
"10": "C'est la dernière version",
"11": "\uD83D\uDCE2 Annonce système : <a target='_blank' href='%s'>%s</a>",
"12": "Échec de la requête asset [%s]",

View file

@ -1089,7 +1089,7 @@
"6": "在筆記本 [%s] 下建立新資料夾 [%s] 失敗:%s",
"7": "在筆記本 [%s] 下刪除 [%s] 失敗:%s",
"8": "檢查更新失敗",
"9": "有新版本可用,請瀏覽發佈公告 %s",
"9": "\uD83D\uDE80 有新版本可用,請瀏覽發佈公告 %s",
"10": "已是最新版",
"11": "\uD83D\uDCE2 系統公告:<a target='_blank' href='%s'>%s</a>",
"12": "查詢資料檔失敗 [%s]",

View file

@ -1089,7 +1089,7 @@
"6": "在笔记本 [%s] 下创建新文件夹 [%s] 失败:%s",
"7": "在笔记本 [%s] 下删除 [%s] 失败:%s",
"8": "检查更新失败",
"9": "有新版本可用,请浏览发布公告 %s",
"9": "\uD83D\uDE80 有新版本可用,请浏览发布公告 %s",
"10": "已是最新版",
"11": "\uD83D\uDCE2 系统公告:<a target='_blank' href='%s'>%s</a>",
"12": "查询资源文件失败 [%s]",

View file

@ -61,7 +61,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
// 搜索
getLang(["search", "searchLimit", "searchLimit1", "memo", "name", "alias", "keywordsLimit",
"doc", "headings", "list1", "listItem", "code", "math", "table", "quote", "superBlock", "paragraph",
"indexAssetPath", "embedBlock", "database"]),
"indexAssetPath", "embedBlock", "database", "searchBackmention", "searchVirtualRef", "searchBlockAttr",
"searchBlockType", "searchCaseSensitive"]),
// 快捷键
getLang(["keymap", "keymapTip2"].concat(Object.keys(Constants.SIYUAN_KEYMAP.general))

View file

@ -26,6 +26,7 @@ import (
"time"
"github.com/88250/gulu"
"github.com/88250/lute/parse"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/model"
@ -462,14 +463,24 @@ func exportPreviewHTML(c *gin.Context) {
if nil != arg["image"] {
image = arg["image"].(bool)
}
name, content := model.ExportHTML(id, "", true, image, keepFold, merge)
name, content, node := model.ExportHTML(id, "", true, image, keepFold, merge)
// 导出 PDF 预览时点击块引转换后的脚注跳转不正确 https://github.com/siyuan-note/siyuan/issues/5894
content = strings.ReplaceAll(content, "http://"+util.LocalHost+":"+util.ServerPort+"/#", "#")
// Add `data-doc-type` and attribute when exporting image and PDF https://github.com/siyuan-note/siyuan/issues/9497
attrs := map[string]string{}
var typ string
if nil != node {
attrs = parse.IAL2Map(node.KramdownIAL)
typ = node.Type.String()
}
ret.Data = map[string]interface{}{
"id": id,
"name": name,
"content": content,
"attrs": attrs,
"type": typ,
}
}
@ -493,7 +504,7 @@ func exportHTML(c *gin.Context) {
if nil != arg["merge"] {
merge = arg["merge"].(bool)
}
name, content := model.ExportHTML(id, savePath, pdf, false, keepFold, merge)
name, content, _ := model.ExportHTML(id, savePath, pdf, false, keepFold, merge)
ret.Data = map[string]interface{}{
"id": id,
"name": name,

View file

@ -585,7 +585,7 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
return
}
func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, dom string) {
func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, dom string, node *ast.Node) {
savePath = strings.TrimSpace(savePath)
bt := treenode.GetBlockTree(id)
@ -594,6 +594,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
}
tree := prepareExportTree(bt)
node = treenode.GetNodeInTree(tree, id)
if merge {
var mergeErr error