Skip to content

Commit

Permalink
Cleanup and update NEWS
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 8, 2019
1 parent 540624d commit fc619ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.2
- spell_check_package() now loads Rd macros (#42)

2.1
- Pre-filter script/style/img tags when checking html files because the huge
embedded binary blogs produced by rmarkdown slow down the hunspell parser.
Expand Down
6 changes: 3 additions & 3 deletions R/check-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ spell_check_description_text <- function(file, dict){
}

spell_check_file_rd <- function(rdfile, macros = NULL, dict) {
if (is.null(macros)) {
text <- tools::RdTextFilter(rdfile)
text <- if (!length(macros)) {
tools::RdTextFilter(rdfile)
} else {
text <- tools::RdTextFilter(rdfile, macros = macros)
tools::RdTextFilter(rdfile, macros = macros)
}
Encoding(text) <- "UTF-8"
spell_check_plain(text, dict = dict)
Expand Down
3 changes: 1 addition & 2 deletions R/spell-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ spell_check_package <- function(pkg = ".", vignettes = TRUE, use_wordlist = TRUE

# Check Rd manual files
rd_files <- sort(list.files(file.path(pkg$path, "man"), "\\.rd$", ignore.case = TRUE, full.names = TRUE))
macros <- tools::loadPkgRdMacros(pkg$path)
macros <- tools::loadRdMacros(
file.path(R.home("share"), "Rd", "macros", "system.Rd"),
macros = macros
tools::loadPkgRdMacros(pkg$path)
)
rd_lines <- lapply(rd_files, spell_check_file_rd, dict = dict, macros = macros)

Expand Down

0 comments on commit fc619ee

Please sign in to comment.