This commit is contained in:
Daniel 2025-08-22 11:06:54 +08:00
parent 980cf25745
commit 76266cac87
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -18,6 +18,7 @@ package filesys
import ( import (
"bytes" "bytes"
"github.com/88250/lute" "github.com/88250/lute"
"github.com/88250/lute/ast" "github.com/88250/lute/ast"
"github.com/88250/lute/parse" "github.com/88250/lute/parse"
@ -126,14 +127,14 @@ func statTree(tree *parse.Tree) (ret *util.BlockStatResult) {
for _, v := range kValues.Values { for _, v := range kValues.Values {
switch kValues.Key.Type { switch kValues.Key.Type {
case av.KeyTypeURL: case av.KeyTypeURL:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
dbLinkCnt++ dbLinkCnt++
content.WriteString(v.URL.Content) content.WriteString(v.URL.Content)
case av.KeyTypeMAsset: case av.KeyTypeMAsset:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
@ -143,7 +144,7 @@ func statTree(tree *parse.Tree) (ret *util.BlockStatResult) {
} }
} }
case av.KeyTypeBlock: case av.KeyTypeBlock:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
@ -152,23 +153,23 @@ func statTree(tree *parse.Tree) (ret *util.BlockStatResult) {
} }
content.WriteString(v.Block.Content) content.WriteString(v.Block.Content)
case av.KeyTypeText: case av.KeyTypeText:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
content.WriteString(v.Text.Content) content.WriteString(v.Text.Content)
case av.KeyTypeNumber: case av.KeyTypeNumber:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
v.Number.FormatNumber() v.Number.FormatNumber()
content.WriteString(v.Number.FormattedContent) content.WriteString(v.Number.FormattedContent)
case av.KeyTypeEmail: case av.KeyTypeEmail:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
content.WriteString(v.Email.Content) content.WriteString(v.Email.Content)
case av.KeyTypePhone: case av.KeyTypePhone:
if v.IsEmpty() { if v.IsBlank() {
continue continue
} }
content.WriteString(v.Phone.Content) content.WriteString(v.Phone.Content)