|
@@ -894,10 +894,16 @@ func ArticleHasStyle(body string) (hasStyle bool, err error) {
|
|
doc.Find("class").Each(func(i int, s *goquery.Selection) {
|
|
doc.Find("class").Each(func(i int, s *goquery.Selection) {
|
|
hasStyle = true
|
|
hasStyle = true
|
|
})
|
|
})
|
|
|
|
+ doc.Find("strong").Each(func(i int, s *goquery.Selection) {
|
|
|
|
+ hasStyle = true // 加粗
|
|
|
|
+ })
|
|
|
|
+ doc.Find("u").Each(func(i int, s *goquery.Selection) {
|
|
|
|
+ hasStyle = true // 下划线
|
|
|
|
+ })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-func ArticleRemoveImgUrl(body string) (result string){
|
|
|
|
|
|
+func ArticleRemoveImgUrl(body string) (result string) {
|
|
// 使用正则表达式去除img标签
|
|
// 使用正则表达式去除img标签
|
|
re := regexp.MustCompile(`<img[^>]*>`)
|
|
re := regexp.MustCompile(`<img[^>]*>`)
|
|
result = re.ReplaceAllString(body, "")
|
|
result = re.ReplaceAllString(body, "")
|