🎨 Export preview mode supports focus use https://github.com/siyuan-note/siyuan/issues/15340

This commit is contained in:
Daniel 2025-07-29 09:51:48 +08:00
parent 1812e84219
commit f7cb4db291
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 9 additions and 3 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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) {