mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 13:58:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
12624110f6
2 changed files with 21 additions and 2 deletions
|
|
@ -119,6 +119,20 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
|
||||
view.LayoutType = newLayout
|
||||
err = av.SaveAttributeView(attrView)
|
||||
|
||||
node, tree, err := getNodeByBlockID(nil, blockID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
node.AttributeViewType = string(view.LayoutType)
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
attrs[av.NodeAttrView] = view.ID
|
||||
err = setNodeAttrs(node, tree, attrs)
|
||||
if err != nil {
|
||||
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -469,7 +483,6 @@ func SetDatabaseBlockView(blockID, avID, viewID string) (err error) {
|
|||
}
|
||||
|
||||
node.AttributeViewType = string(view.LayoutType)
|
||||
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
attrs[av.NodeAttrView] = viewID
|
||||
err = setNodeAttrs(node, tree, attrs)
|
||||
|
|
|
|||
|
|
@ -127,10 +127,16 @@ func ListNotebooks() (ret []*Box, err error) {
|
|||
}
|
||||
|
||||
id := dir.Name()
|
||||
icon := boxConf.Icon
|
||||
if strings.Contains(icon, ".") { // 说明是自定义图标
|
||||
// XSS through emoji name https://github.com/siyuan-note/siyuan/issues/15034
|
||||
icon = util.FilterUploadFileName(icon)
|
||||
}
|
||||
|
||||
box := &Box{
|
||||
ID: id,
|
||||
Name: boxConf.Name,
|
||||
Icon: boxConf.Icon,
|
||||
Icon: icon,
|
||||
Sort: boxConf.Sort,
|
||||
SortMode: boxConf.SortMode,
|
||||
Closed: boxConf.Closed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue