🎨 Supports searching database blocks by the view title https://github.com/siyuan-note/siyuan/issues/9348

This commit is contained in:
Daniel 2023-10-05 12:02:17 +08:00
parent cf154dcaa1
commit d38311c48c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 40 additions and 28 deletions

View file

@ -22,6 +22,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/siyuan-note/siyuan/kernel/av"
"image"
"image/jpeg"
"image/png"
@ -154,7 +155,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
// 重新指向数据库属性值
ial := parse.IAL2Map(n.KramdownIAL)
for k, _ := range ial {
if strings.HasPrefix(k, NodeAttrNameAvs) {
if strings.HasPrefix(k, av.NodeAttrNameAvs) {
avBlockIDs[oldNodeID] = newNodeID
}
}
@ -257,7 +258,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
ial := parse.IAL2Map(n.KramdownIAL)
for k, v := range ial {
if strings.HasPrefix(k, NodeAttrNameAvs) {
if strings.HasPrefix(k, av.NodeAttrNameAvs) {
newKey, newVal := k, v
for oldAvID, newAvID := range avIDs {
newKey = strings.ReplaceAll(newKey, oldAvID, newAvID)