This commit is contained in:
Daniel 2025-05-18 10:53:40 +08:00
parent ca93066171
commit 248c0c1704
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 8 additions and 3 deletions

View file

@ -266,6 +266,7 @@ export class Preview {
} else if (type === "yuque") {
fetchPost("/api/lute/copyStdMarkdown", {
id: protyle.block.rootID,
assetsDestSpace2Underscore: true,
}, (response) => {
writeText(response.data);
showMessage(`${window.siyuan.languages.pasteToYuque}`);

View file

@ -44,7 +44,11 @@ func copyStdMarkdown(c *gin.Context) {
}
id := arg["id"].(string)
ret.Data = model.ExportStdMarkdown(id)
assetsDestSpace2Underscore := false
if nil != arg["assetsDestSpace2Underscore"] {
assetsDestSpace2Underscore = arg["assetsDestSpace2Underscore"].(bool)
}
ret.Data = model.ExportStdMarkdown(id, assetsDestSpace2Underscore)
}
func html2BlockDOM(c *gin.Context) {

View file

@ -1449,7 +1449,7 @@ func processPDFLinkEmbedAssets(pdfCtx *model.Context, assetDests []string, remov
}
}
func ExportStdMarkdown(id string) string {
func ExportStdMarkdown(id string, assetsDestSpace2Underscore bool) string {
tree, err := LoadTreeByBlockID(id)
if err != nil {
logging.LogErrorf("load tree by block id [%s] failed: %s", id, err)
@ -1487,7 +1487,7 @@ func ExportStdMarkdown(id string) string {
}
defBlockIDs = gulu.Str.RemoveDuplicatedElem(defBlockIDs)
return exportMarkdownContent0(tree, cloudAssetsBase, false,
return exportMarkdownContent0(tree, cloudAssetsBase, assetsDestSpace2Underscore,
".md", Conf.Export.BlockRefMode, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
Conf.Export.TagOpenMarker, Conf.Export.TagCloseMarker,
Conf.Export.BlockRefTextLeft, Conf.Export.BlockRefTextRight,