|
@@ -1924,6 +1924,12 @@ func ArticleAnnotation(item *models.HomeArticle) (annotation string) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+//func init() {
|
|
|
+// strss := AnnotationHtml("")
|
|
|
+//
|
|
|
+// fmt.Println(strss)
|
|
|
+//}
|
|
|
+
|
|
|
// 处理核心观点的展示规则
|
|
|
func AnnotationHtml(bodyText string) (annotation string) {
|
|
|
if bodyText == "" {
|
|
@@ -1966,6 +1972,17 @@ func AnnotationHtml(bodyText string) (annotation string) {
|
|
|
mapSort = append(mapSort, textLen)
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ section := doc.Find("section")
|
|
|
+ section.Each(func(tk int, section *goquery.Selection) {
|
|
|
+ sectionText := section.Text()
|
|
|
+ sectionText = strings.Replace(sectionText, " ", "", -1)
|
|
|
+ if sectionText != "" {
|
|
|
+ textLen := strings.Index(docText, sectionText)
|
|
|
+ mapDoc[(strings.Index(docText, sectionText))] = sectionText
|
|
|
+ mapSort = append(mapSort, textLen)
|
|
|
+ }
|
|
|
+ })
|
|
|
if len(mapSort) == 0 {
|
|
|
return
|
|
|
} else {
|