mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 09:54:07 +01:00
🎨 新增获取块 kramdown 源代码的 API https://github.com/siyuan-note/siyuan/issues/5289
This commit is contained in:
parent
e1b45b40e5
commit
6723b3a20d
6 changed files with 121 additions and 30 deletions
|
|
@ -319,3 +319,20 @@ func getBlockDOM(c *gin.Context) {
|
|||
"dom": dom,
|
||||
}
|
||||
}
|
||||
|
||||
func getBlockKramdown(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
kramdown := model.GetBlockKramdown(id)
|
||||
ret.Data = map[string]string{
|
||||
"id": id,
|
||||
"kramdown": kramdown,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue