mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
30a5cdc9f5
commit
1e2a707e02
4 changed files with 26 additions and 6 deletions
|
|
@ -118,6 +118,25 @@ func renderBlockDOMByNodes(nodes []*ast.Node, luteEngine *lute.Lute) string {
|
|||
return h
|
||||
}
|
||||
|
||||
func renderBlockContentByNodes(nodes []*ast.Node) string {
|
||||
var subNodes []*ast.Node
|
||||
for _, n := range nodes {
|
||||
if ast.NodeDocument == n.Type {
|
||||
for c := n.FirstChild; nil != c; c = c.Next {
|
||||
subNodes = append(subNodes, c)
|
||||
}
|
||||
} else {
|
||||
subNodes = append(subNodes, n)
|
||||
}
|
||||
}
|
||||
|
||||
buf := bytes.Buffer{}
|
||||
for _, n := range subNodes {
|
||||
buf.WriteString(treenode.NodeStaticContent(n, nil))
|
||||
}
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
func renderBlockMarkdownR(id string) string {
|
||||
var rendered []string
|
||||
nodes := renderBlockMarkdownR0(id, &rendered)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue