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

This commit is contained in:
Vanessa 2025-02-18 17:07:23 +08:00
commit b3105faf65
2 changed files with 6 additions and 8 deletions

View file

@ -412,12 +412,12 @@ func exportMdContent(c *gin.Context) {
refMode := model.Conf.Export.BlockRefMode
if nil != arg["refMode"] {
refMode = arg["refMode"].(int)
refMode = int(arg["refMode"].(float64))
}
embedMode := model.Conf.Export.BlockEmbedMode
if nil != arg["embedMode"] {
embedMode = arg["embedMode"].(int)
embedMode = int(arg["embedMode"].(float64))
}
yfm := true

View file

@ -1490,11 +1490,6 @@ func ExportNotebookMarkdown(boxID string) (zipPath string) {
func yfm(docIAL map[string]string) string {
// 导出 Markdown 文件时开头附上一些元数据 https://github.com/siyuan-note/siyuan/issues/6880
if !Conf.Export.MarkdownYFM {
// 导出 Markdown 时在文档头添加 YFM 开关 https://github.com/siyuan-note/siyuan/issues/7727
return ""
}
buf := bytes.Buffer{}
buf.WriteString("---\n")
var title, created, updated, tags string
@ -1959,7 +1954,10 @@ func exportMarkdownContent(id, ext string, exportRefMode int, defBlockIDs []stri
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
Conf.Export.AddTitle, defBlockIDs, singleFile, treeCache)
docIAL := parse.IAL2Map(tree.Root.KramdownIAL)
exportedMd = yfm(docIAL) + exportedMd
if Conf.Export.MarkdownYFM {
// 导出 Markdown 时在文档头添加 YFM 开关 https://github.com/siyuan-note/siyuan/issues/7727
exportedMd = yfm(docIAL) + exportedMd
}
return
}