mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🎨 Export preview mode supports focus use https://github.com/siyuan-note/siyuan/issues/15340
This commit is contained in:
parent
1812e84219
commit
f7cb4db291
3 changed files with 9 additions and 3 deletions
|
|
@ -279,6 +279,7 @@ export class Preview {
|
|||
fetchPost("/api/lute/copyStdMarkdown", {
|
||||
id: protyle.block.id || protyle.options.blockId || protyle.block.parentID,
|
||||
assetsDestSpace2Underscore: true,
|
||||
fillCSSVar: true,
|
||||
adjustHeadingLevel: true,
|
||||
}, (response) => {
|
||||
writeText(response.data);
|
||||
|
|
|
|||
|
|
@ -49,12 +49,17 @@ func copyStdMarkdown(c *gin.Context) {
|
|||
assetsDestSpace2Underscore = arg["assetsDestSpace2Underscore"].(bool)
|
||||
}
|
||||
|
||||
fillCSSVar := false
|
||||
if nil != arg["fillCSSVar"] {
|
||||
fillCSSVar = arg["fillCSSVar"].(bool)
|
||||
}
|
||||
|
||||
adjustHeadingLevel := false
|
||||
if nil != arg["adjustHeadingLevel"] {
|
||||
adjustHeadingLevel = arg["adjustHeadingLevel"].(bool)
|
||||
}
|
||||
|
||||
ret.Data = model.ExportStdMarkdown(id, assetsDestSpace2Underscore, adjustHeadingLevel)
|
||||
ret.Data = model.ExportStdMarkdown(id, assetsDestSpace2Underscore, fillCSSVar, adjustHeadingLevel)
|
||||
}
|
||||
|
||||
func html2BlockDOM(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -1457,7 +1457,7 @@ func processPDFLinkEmbedAssets(pdfCtx *model.Context, assetDests []string, remov
|
|||
}
|
||||
}
|
||||
|
||||
func ExportStdMarkdown(id string, assetsDestSpace2Underscore, adjustHeadingLevel bool) string {
|
||||
func ExportStdMarkdown(id string, assetsDestSpace2Underscore, fillCSSVar, adjustHeadingLevel bool) string {
|
||||
bt := treenode.GetBlockTree(id)
|
||||
if nil == bt {
|
||||
logging.LogErrorf("block tree [%s] not found", id)
|
||||
|
|
@ -1500,7 +1500,7 @@ func ExportStdMarkdown(id string, assetsDestSpace2Underscore, adjustHeadingLevel
|
|||
".md", Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
|
||||
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
|
||||
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, true, false, &map[string]*parse.Tree{})
|
||||
Conf.Export.AddTitle, Conf.Export.InlineMemo, defBlockIDs, true, fillCSSVar, &map[string]*parse.Tree{})
|
||||
}
|
||||
|
||||
func ExportPandocConvertZip(ids []string, pandocTo, ext string) (name, zipPath string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue