This commit is contained in:
Liang Ding 2022-10-01 12:03:22 +08:00
parent ae8ce006ba
commit a772b47287
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
6 changed files with 36 additions and 11 deletions

View file

@ -31,6 +31,11 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func TreeStat(tree *parse.Tree) (runeCount, wordCount int) {
runeCount, wordCount = tree.Root.ContentLen()
return
}
func NodeHash(node *ast.Node, tree *parse.Tree, luteEngine *lute.Lute) string {
ialArray := node.KramdownIAL
sort.Slice(ialArray, func(i, j int) bool {