🎨 Improve kernel API /api/block/getBlockKramdown https://github.com/siyuan-note/siyuan/issues/13183

This commit is contained in:
Daniel 2024-11-20 10:33:42 +08:00
parent 9f46e09f7f
commit 371c64c471
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 23 additions and 3 deletions

View file

@ -603,7 +603,20 @@ func getBlockKramdown(c *gin.Context) {
return
}
kramdown := model.GetBlockKramdown(id)
// mdMarkdown 标记符模式,使用标记符导出
// textmark文本标记模式使用 span 标签导出
// https://github.com/siyuan-note/siyuan/issues/13183
mode := "md"
if modeArg := arg["mode"]; nil != modeArg {
mode = modeArg.(string)
if "md" != mode && "textmark" != mode {
ret.Code = -1
ret.Msg = "Invalid mode"
return
}
}
kramdown := model.GetBlockKramdown(id, mode)
ret.Data = map[string]string{
"id": id,
"kramdown": kramdown,