mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-02 13:41:48 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
40ae99e278
commit
9010967b04
2 changed files with 5 additions and 12 deletions
|
|
@ -487,16 +487,16 @@ func exportMdContent(c *gin.Context) {
|
|||
imgTag = arg["imgTag"].(bool)
|
||||
}
|
||||
|
||||
addTitleMode := 0 // 0:未指定(遵循全局设置 Conf.Export.AddTitle),1:添加标题,2:不添加标题
|
||||
addTitle := model.Conf.Export.AddTitle
|
||||
if nil != arg["addTitle"] {
|
||||
if arg["addTitle"].(bool) {
|
||||
addTitleMode = 1
|
||||
addTitle = true
|
||||
} else {
|
||||
addTitleMode = 2
|
||||
addTitle = false
|
||||
}
|
||||
}
|
||||
|
||||
hPath, content := model.ExportMarkdownContent(id, refMode, embedMode, addTitleMode, yfm, fillCSSVar, adjustHeadingLevel, imgTag)
|
||||
hPath, content := model.ExportMarkdownContent(id, refMode, embedMode, yfm, fillCSSVar, adjustHeadingLevel, imgTag, addTitle)
|
||||
ret.Data = map[string]interface{}{
|
||||
"hPath": hPath,
|
||||
"content": content,
|
||||
|
|
|
|||
|
|
@ -2221,19 +2221,12 @@ func walkRelationAvs(avID string, exportAvIDs *hashset.Set) {
|
|||
}
|
||||
}
|
||||
|
||||
func ExportMarkdownContent(id string, refMode, embedMode, addTitleMode int, addYfm, fillCSSVar, adjustHeadingLv, imgTag bool) (hPath, exportedMd string) {
|
||||
func ExportMarkdownContent(id string, refMode, embedMode int, addYfm, fillCSSVar, adjustHeadingLv, imgTag, addTitle bool) (hPath, exportedMd string) {
|
||||
bt := treenode.GetBlockTree(id)
|
||||
if nil == bt {
|
||||
return
|
||||
}
|
||||
|
||||
addTitle := Conf.Export.AddTitle
|
||||
if 1 == addTitleMode { // 0:未指定(遵循全局设置 Conf.Export.AddTitle),1:添加标题,2:不添加标题
|
||||
addTitle = true
|
||||
} else if 2 == addTitleMode {
|
||||
addTitle = false
|
||||
}
|
||||
|
||||
tree := prepareExportTree(bt)
|
||||
hPath = tree.HPath
|
||||
exportedMd = exportMarkdownContent0(id, tree, "", false, adjustHeadingLv, imgTag,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue