|
@@ -42,25 +42,6 @@ func GetReportContentSub(content string) (contentSub string, err error) {
|
|
|
func GetReportContentTextSub(content string) (contentSub string, err error) {
|
|
|
content = html.UnescapeString(content)
|
|
|
doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
|
|
|
- //if err != nil {
|
|
|
- // fmt.Println("create doc err:", err.Error())
|
|
|
- // return
|
|
|
- //}
|
|
|
- //doc.Find("p").Each(func(i int, s *goquery.Selection) {
|
|
|
- // pHtml, _ := s.Html()
|
|
|
- // if strings.Contains(pHtml, "img") || strings.Contains(pHtml, "table") {
|
|
|
- // s.Remove()
|
|
|
- // }
|
|
|
- //})
|
|
|
- //if contentSub == "" || len(contentSub) < 200 {
|
|
|
- // //m := 0
|
|
|
- // doc.Find("span").Each(func(i int, s *goquery.Selection) {
|
|
|
- // spanHtml, _ := s.Html()
|
|
|
- // if strings.Contains(spanHtml, "img") || strings.Contains(spanHtml, "table") {
|
|
|
- // s.Remove()
|
|
|
- // }
|
|
|
- // })
|
|
|
- //}
|
|
|
docText := doc.Text()
|
|
|
bodyRune := []rune(docText)
|
|
|
bodyRuneLen := len(bodyRune)
|