mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Export preview mode supports focus use https://github.com/siyuan-note/siyuan/issues/15340
This commit is contained in:
parent
81644059ac
commit
49d233d92a
2 changed files with 12 additions and 6 deletions
|
|
@ -431,7 +431,12 @@ func exportMdContent(c *gin.Context) {
|
|||
fillCSSVar = arg["fillCSSVar"].(bool)
|
||||
}
|
||||
|
||||
hPath, content := model.ExportMarkdownContent(id, refMode, embedMode, yfm, fillCSSVar)
|
||||
adjustHeadingLevel := false
|
||||
if nil != arg["adjustHeadingLevel"] {
|
||||
adjustHeadingLevel = arg["adjustHeadingLevel"].(bool)
|
||||
}
|
||||
|
||||
hPath, content := model.ExportMarkdownContent(id, refMode, embedMode, yfm, fillCSSVar, adjustHeadingLevel)
|
||||
ret.Data = map[string]interface{}{
|
||||
"hPath": hPath,
|
||||
"content": content,
|
||||
|
|
|
|||
|
|
@ -1458,12 +1458,13 @@ func processPDFLinkEmbedAssets(pdfCtx *model.Context, assetDests []string, remov
|
|||
}
|
||||
|
||||
func ExportStdMarkdown(id string, assetsDestSpace2Underscore, adjustHeadingLevel bool) string {
|
||||
tree, err := LoadTreeByBlockID(id)
|
||||
if err != nil {
|
||||
logging.LogErrorf("load tree by block id [%s] failed: %s", id, err)
|
||||
bt := treenode.GetBlockTree(id)
|
||||
if nil == bt {
|
||||
logging.LogErrorf("block tree [%s] not found", id)
|
||||
return ""
|
||||
}
|
||||
|
||||
tree := prepareExportTree(bt)
|
||||
cloudAssetsBase := ""
|
||||
if IsSubscriber() {
|
||||
cloudAssetsBase = util.GetCloudAssetsServer() + Conf.GetUser().UserId + "/"
|
||||
|
|
@ -1981,7 +1982,7 @@ func walkRelationAvs(avID string, exportAvIDs *hashset.Set) {
|
|||
}
|
||||
}
|
||||
|
||||
func ExportMarkdownContent(id string, refMode, embedMode int, addYfm, fillCSSVar bool) (hPath, exportedMd string) {
|
||||
func ExportMarkdownContent(id string, refMode, embedMode int, addYfm, fillCSSVar, adjustHeadingLv bool) (hPath, exportedMd string) {
|
||||
bt := treenode.GetBlockTree(id)
|
||||
if nil == bt {
|
||||
return
|
||||
|
|
@ -1989,7 +1990,7 @@ func ExportMarkdownContent(id string, refMode, embedMode int, addYfm, fillCSSVar
|
|||
|
||||
tree := prepareExportTree(bt)
|
||||
hPath = tree.HPath
|
||||
exportedMd = exportMarkdownContent0(id, tree, "", false, false,
|
||||
exportedMd = exportMarkdownContent0(id, tree, "", false, adjustHeadingLv,
|
||||
".md", refMode, embedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue