Skip to content

Commit

Permalink
use xfun::strip_html()
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed May 5, 2023
1 parent 8442b5a commit a39e8f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Imports:
knitr (>= 1.38),
rmarkdown (>= 2.14),
jquerylib,
xfun (>= 0.29),
xfun (>= 0.39),
tinytex (>= 0.12),
yaml (>= 2.1.19)
Suggests:
Expand Down
5 changes: 1 addition & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,7 @@ clean_meta = function(meta_file, files) {

# remove HTML tags and remove extra spaces
strip_html = function(x) {
x = gsub('<!--.*?-->', '', x) # remove comments
x = gsub('<[^>]+>', '', x)
x = gsub('\\s{2,}', ' ', x)
x
gsub('\\s{2,}', ' ', xfun::strip_html(x))
}

# remove the <script><script> content and references
Expand Down

0 comments on commit a39e8f4

Please sign in to comment.