mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 23:08:49 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15590
This commit is contained in:
parent
8c3837deaa
commit
e1fca0674d
2 changed files with 6 additions and 6 deletions
|
|
@ -75,12 +75,12 @@ func (value *Value) String(format bool) string {
|
||||||
if nil == value.Block {
|
if nil == value.Block {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return value.Block.Content
|
return strings.TrimSpace(value.Block.Content)
|
||||||
case KeyTypeText:
|
case KeyTypeText:
|
||||||
if nil == value.Text {
|
if nil == value.Text {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return value.Text.Content
|
return strings.TrimSpace(value.Text.Content)
|
||||||
case KeyTypeNumber:
|
case KeyTypeNumber:
|
||||||
if nil == value.Number {
|
if nil == value.Number {
|
||||||
return ""
|
return ""
|
||||||
|
|
@ -113,17 +113,17 @@ func (value *Value) String(format bool) string {
|
||||||
if nil == value.URL {
|
if nil == value.URL {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return value.URL.Content
|
return strings.TrimSpace(value.URL.Content)
|
||||||
case KeyTypeEmail:
|
case KeyTypeEmail:
|
||||||
if nil == value.Email {
|
if nil == value.Email {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return value.Email.Content
|
return strings.TrimSpace(value.Email.Content)
|
||||||
case KeyTypePhone:
|
case KeyTypePhone:
|
||||||
if nil == value.Phone {
|
if nil == value.Phone {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return value.Phone.Content
|
return strings.TrimSpace(value.Phone.Content)
|
||||||
case KeyTypeMAsset:
|
case KeyTypeMAsset:
|
||||||
if 1 > len(value.MAsset) {
|
if 1 > len(value.MAsset) {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView,
|
||||||
|
|
||||||
fixDev := false
|
fixDev := false
|
||||||
for _, groupView := range view.Groups {
|
for _, groupView := range view.Groups {
|
||||||
if ("" == groupView.GetGroupValue() || nil == groupView.GroupKey) && !fixDev {
|
if (nil == groupView.GroupVal || nil == groupView.GroupKey) && !fixDev {
|
||||||
// TODO 分组上线后删除,预计 2025 年 9 月后可以删除
|
// TODO 分组上线后删除,预计 2025 年 9 月后可以删除
|
||||||
regenAttrViewGroups(attrView, "force")
|
regenAttrViewGroups(attrView, "force")
|
||||||
av.SaveAttributeView(attrView)
|
av.SaveAttributeView(attrView)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue