mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
efa308d945
commit
9c1d6a1a70
12 changed files with 63 additions and 67 deletions
|
|
@ -19,7 +19,6 @@ package model
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/88250/lute/parse"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/av"
|
||||
|
|
@ -94,7 +93,7 @@ func removeAttributeViewBlock(blockID, avID string, tree *parse.Tree) (err error
|
|||
}
|
||||
|
||||
for i, row := range attrView.Rows {
|
||||
if row[0].Value() == blockID {
|
||||
if row.Cells[0].(*av.Cell).Value == blockID {
|
||||
attrView.Rows = append(attrView.Rows[:i], attrView.Rows[i+1:]...)
|
||||
break
|
||||
}
|
||||
|
|
@ -124,18 +123,18 @@ func addAttributeViewBlock(blockID, avID string, tree *parse.Tree) (err error) {
|
|||
|
||||
// 不允许重复添加相同的块到属性视图中
|
||||
for _, row := range attrView.Rows {
|
||||
if row[0].Value() == blockID {
|
||||
if row.Cells[0].(*av.Cell).Value == blockID {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var row []av.Cell
|
||||
row = append(row, av.NewCellBlock(block.ID))
|
||||
row := av.NewRow()
|
||||
row.Cells = append(row.Cells, av.NewCellBlock(block.ID))
|
||||
if 1 < len(attrView.Columns) {
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
|
||||
for _, col := range attrView.Columns[1:] {
|
||||
colName := col.Name()
|
||||
colName := col.(*av.Column).Name
|
||||
attrs[colName] = ""
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue