Browse Source

过滤文章编辑器自带的垃圾格式 v2

xingzai 2 years ago
parent
commit
9c0aa32993
1 changed files with 3 additions and 3 deletions
  1. 3 3
      services/article.go

+ 3 - 3
services/article.go

@@ -68,9 +68,9 @@ func GetReportContentTextSubNew(content string) (contentSub string, err error) {
 	bodyRuneLen := len(bodyRune)
 	body := string(bodyRune[:bodyRuneLen])
 	contentSub = body
-	contentSub = strings.Replace(body, "Powered by Froala Editor", "", -1)
-	contentSub = strings.Replace(body, " ", "", -1)
-	contentSub = strings.Replace(body, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;\">Powered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
+	contentSub = strings.Replace(contentSub, "Powered by Froala Editor", "", -1)
+	contentSub = strings.Replace(contentSub, " ", "", -1)
+	contentSub = strings.Replace(contentSub, "<p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sanered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>", "", -1)
 	return
 }