瀏覽代碼

no message

xingzai 1 年之前
父節點
當前提交
0124cbf5c1
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 1 1
      controllers/yanxuan_special.go
  2. 7 1
      utils/common.go

+ 1 - 1
controllers/yanxuan_special.go

@@ -1171,7 +1171,7 @@ func (this *YanxuanSpecialController) Check() {
 // @Description 上传文章阅读时间接口
 // @Param  request	body models.AddStopTimeRep true "type json string"
 // @Success 200 {object} models.ArticleDetailResp
-// @router /addStopTime [post]
+// @router /addStopTimedel [post]
 func (this *YanxuanSpecialController) AddStopTime() {
 	br := new(models.BaseResponse).Init()
 	defer func() {

+ 7 - 1
utils/common.go

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