🎨 API /api/block/* 支持插入或更新带有块级 IAL 的空段落块 Fix https://github.com/siyuan-note/siyuan/issues/6713

This commit is contained in:
Liang Ding 2022-11-25 18:04:55 +08:00
parent aafbd204db
commit c0d1451c7b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 10 additions and 29 deletions

View file

@ -29,7 +29,6 @@ import (
"github.com/88250/lute"
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
util2 "github.com/88250/lute/util"
"github.com/siyuan-note/siyuan/kernel/util"
)
@ -86,24 +85,6 @@ func NewTree(boxID, p, hp, title string) *parse.Tree {
return ret
}
func IsEmptyBlockIAL(n *ast.Node) bool {
if ast.NodeKramdownBlockIAL != n.Type {
return false
}
if util2.IsDocIAL(n.Tokens) {
return false
}
if nil != n.Previous {
if ast.NodeKramdownBlockIAL == n.Previous.Type {
return true
}
return false
}
return true
}
func IALStr(n *ast.Node) string {
if 1 > len(n.KramdownIAL) {
return ""