Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-05-09 16:35:15 +08:00
commit ed7e5b7135
5 changed files with 17 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20240505150113-bc43bd50f866
github.com/88250/lute v1.7.7-0.20240509012351-9de36465ffc1
github.com/88250/lute v1.7.7-0.20240509082412-8cc219959c2b
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4

View file

@ -12,8 +12,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20240505150113-bc43bd50f866 h1:RFfNFS0hv6TbOuwET6xZAfGlV4hNlXiWTnfbLN1eF6k=
github.com/88250/gulu v1.2.3-0.20240505150113-bc43bd50f866/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8=
github.com/88250/lute v1.7.7-0.20240509012351-9de36465ffc1 h1:xi4lqnWncqD9nE9p03iDoPyApPqWdrAfjY1c/ZK7/+c=
github.com/88250/lute v1.7.7-0.20240509012351-9de36465ffc1/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
github.com/88250/lute v1.7.7-0.20240509082412-8cc219959c2b h1:grdsmJN5srsGVX1Ryihw1WWSNV/TkSCu3FXx5J3qjGs=
github.com/88250/lute v1.7.7-0.20240509082412-8cc219959c2b/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
@ -378,6 +379,12 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
var keyValues []*av.KeyValues
for _, kv := range attrView.KeyValues {
if av.KeyTypeLineNumber == kv.Key.Type {
// 属性面板中不显示行号字段
// The line number field no longer appears in the database attribute panel https://github.com/siyuan-note/siyuan/issues/11319
continue
}
kValues := &av.KeyValues{Key: kv.Key}
for _, v := range kv.Values {
if v.BlockID == blockID {
@ -2216,6 +2223,8 @@ func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr)
}
func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, blockID, previousBlockID string, ignoreFillFilter bool) (err error) {
slices.Reverse(srcs) // https://github.com/siyuan-note/siyuan/issues/11286
for _, src := range srcs {
srcID := src["id"].(string)
isDetached := src["isDetached"].(bool)

View file

@ -226,7 +226,7 @@ func BuildTags() (ret *Tags) {
tmp := &Tags{}
for _, tag := range tags {
*tmp = append(*tmp, tag)
total += countTag(tag)
countTag(tag, &total)
if Conf.FileTree.MaxListCount < total {
util.PushMsg(fmt.Sprintf(Conf.Language(243), Conf.FileTree.MaxListCount), 7000)
break
@ -237,12 +237,11 @@ func BuildTags() (ret *Tags) {
return
}
func countTag(tag *Tag) int {
count := 1
func countTag(tag *Tag, total *int) {
*total += 1
for _, child := range tag.tags {
count += countTag(child)
countTag(child, total)
}
return count + tag.Count
}
func sortTags(tags Tags) {