|
@@ -1804,7 +1804,7 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
|
|
|
if item.Annotation != "" {
|
|
|
annotation = strings.Replace(item.Annotation, "<br>", "", -1)
|
|
|
} else {
|
|
|
- annotation = item.Abstract
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
bodyText, _ := GetReportContentTextSubNew(annotation)
|
|
@@ -1831,19 +1831,23 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
|
|
|
mapDoc[(strings.Index(docText, liText))] = strconv.Itoa(tk+1) + "." + liText
|
|
|
mapSort = append(mapSort, textLen)
|
|
|
})
|
|
|
- //排序
|
|
|
- sort.Ints(mapSort)
|
|
|
- var annotationHtml string
|
|
|
- for _, vSort := range mapSort {
|
|
|
- for k, v := range mapDoc {
|
|
|
- if k == vSort {
|
|
|
- annotationHtml += v + "<br>"
|
|
|
+ if len(mapSort) == 0 {
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ //排序
|
|
|
+ sort.Ints(mapSort)
|
|
|
+ var annotationHtml string
|
|
|
+ for _, vSort := range mapSort {
|
|
|
+ for k, v := range mapDoc {
|
|
|
+ if k == vSort {
|
|
|
+ annotationHtml += v + "<br>"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ annotationHtml = strings.TrimRight(annotationHtml, "<br>")
|
|
|
+ annotationHtml = "<p>" + annotationHtml + "</p>"
|
|
|
+ annotation = annotationHtml
|
|
|
}
|
|
|
- annotationHtml = strings.TrimRight(annotationHtml, "<br>")
|
|
|
- annotationHtml = "<p>" + annotationHtml + "</p>"
|
|
|
- annotation = annotationHtml
|
|
|
}
|
|
|
return
|
|
|
}
|