Skip to content

Commit

Permalink
cut script and blockquote elements
Browse files Browse the repository at this point in the history
  • Loading branch information
wedojava committed Oct 9, 2020
1 parent 874f276 commit 0489467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/fetcher/sites/cna/cna.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ func cna(p *Post) (string, error) {

re := regexp.MustCompile(`<a.*?>`)
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`<script.*?</script>`)
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`<iframe.*?</iframe>`)
body = re.ReplaceAllString(body, "")

Expand Down
4 changes: 4 additions & 0 deletions internal/fetcher/sites/ltn/ltn.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ func ltn(p *Post) (string, error) {
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`</a>`)
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`<script.*?</script>`)
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`<blockquote.*?</blockquote>`)
body = re.ReplaceAllString(body, "")
re = regexp.MustCompile(`<iframe.*?</iframe>`)
body = re.ReplaceAllString(body, "")

Expand Down

0 comments on commit 0489467

Please # to comment.