mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-18 14:35:27 +01:00
🎨 Improve exporting to YueQue https://github.com/siyuan-note/siyuan/issues/14846
This commit is contained in:
parent
ca93066171
commit
248c0c1704
3 changed files with 8 additions and 3 deletions
|
|
@ -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}`);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue