|
@@ -168,7 +168,7 @@ func IsNodeOCRed(node *ast.Node) (ret bool) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATitleURL, includeAssetPath bool) string {
|
|
|
+func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATitleURL, includeAssetPath, fullAttrView bool) string {
|
|
|
if nil == node {
|
|
|
return ""
|
|
|
}
|
|
@@ -178,7 +178,11 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
|
|
|
}
|
|
|
|
|
|
if ast.NodeAttributeView == node.Type {
|
|
|
- return getAttributeViewContent(node.AttributeViewID)
|
|
|
+ if fullAttrView {
|
|
|
+ return getAttributeViewContent(node.AttributeViewID)
|
|
|
+ }
|
|
|
+
|
|
|
+ return getAttributeViewName(node.AttributeViewID)
|
|
|
}
|
|
|
|
|
|
buf := bytes.Buffer{}
|
|
@@ -528,6 +532,28 @@ func GetAttributeViewName(avID string) (name string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func getAttributeViewName(avID string) (name string) {
|
|
|
+ if "" == avID {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ attrView, err := av.ParseAttributeView(avID)
|
|
|
+ if nil != err {
|
|
|
+ logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ buf := bytes.Buffer{}
|
|
|
+ buf.WriteString(attrView.Name)
|
|
|
+ buf.WriteByte(' ')
|
|
|
+ for _, v := range attrView.Views {
|
|
|
+ buf.WriteString(v.Name)
|
|
|
+ buf.WriteByte(' ')
|
|
|
+ }
|
|
|
+ name = strings.TrimSpace(buf.String())
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func getAttributeViewContent(avID string) (content string) {
|
|
|
if "" == avID {
|
|
|
return
|