mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🧑💻 Add kernel API /api/block/getBlockDOMs https://github.com/siyuan-note/siyuan/issues/15004
This commit is contained in:
parent
475eeb6b15
commit
f4a5bd105f
3 changed files with 38 additions and 1 deletions
|
|
@ -696,6 +696,24 @@ func GetBlockDOM(id string) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetBlockDOMs(ids []string) (ret map[string]string) {
|
||||
ret = map[string]string{}
|
||||
if 0 == len(ids) {
|
||||
return
|
||||
}
|
||||
|
||||
luteEngine := NewLute()
|
||||
trees := filesys.LoadTrees(ids)
|
||||
for id, tree := range trees {
|
||||
node := treenode.GetNodeInTree(tree, id)
|
||||
if nil == node {
|
||||
continue
|
||||
}
|
||||
ret[id] = luteEngine.RenderNodeBlockDOM(node)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetBlockKramdown(id, mode string) (ret string) {
|
||||
if "" == id {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue