mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
b3105faf65
2 changed files with 6 additions and 8 deletions
|
|
@ -412,12 +412,12 @@ func exportMdContent(c *gin.Context) {
|
||||||
|
|
||||||
refMode := model.Conf.Export.BlockRefMode
|
refMode := model.Conf.Export.BlockRefMode
|
||||||
if nil != arg["refMode"] {
|
if nil != arg["refMode"] {
|
||||||
refMode = arg["refMode"].(int)
|
refMode = int(arg["refMode"].(float64))
|
||||||
}
|
}
|
||||||
|
|
||||||
embedMode := model.Conf.Export.BlockEmbedMode
|
embedMode := model.Conf.Export.BlockEmbedMode
|
||||||
if nil != arg["embedMode"] {
|
if nil != arg["embedMode"] {
|
||||||
embedMode = arg["embedMode"].(int)
|
embedMode = int(arg["embedMode"].(float64))
|
||||||
}
|
}
|
||||||
|
|
||||||
yfm := true
|
yfm := true
|
||||||
|
|
|
||||||
|
|
@ -1490,11 +1490,6 @@ func ExportNotebookMarkdown(boxID string) (zipPath string) {
|
||||||
func yfm(docIAL map[string]string) string {
|
func yfm(docIAL map[string]string) string {
|
||||||
// 导出 Markdown 文件时开头附上一些元数据 https://github.com/siyuan-note/siyuan/issues/6880
|
// 导出 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 := bytes.Buffer{}
|
||||||
buf.WriteString("---\n")
|
buf.WriteString("---\n")
|
||||||
var title, created, updated, tags string
|
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.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||||
Conf.Export.AddTitle, defBlockIDs, singleFile, treeCache)
|
Conf.Export.AddTitle, defBlockIDs, singleFile, treeCache)
|
||||||
docIAL := parse.IAL2Map(tree.Root.KramdownIAL)
|
docIAL := parse.IAL2Map(tree.Root.KramdownIAL)
|
||||||
|
if Conf.Export.MarkdownYFM {
|
||||||
|
// 导出 Markdown 时在文档头添加 YFM 开关 https://github.com/siyuan-note/siyuan/issues/7727
|
||||||
exportedMd = yfm(docIAL) + exportedMd
|
exportedMd = yfm(docIAL) + exportedMd
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue