Skip to content

Commit 3660f29

Browse files
committed
ok
1 parent e07e72f commit 3660f29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

R/spell-check-bookdown.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ spell_check_bookdown <- function(path = ".", lang = NULL, use_wordlist = TRUE){
3737
# Get language from DESCRIPTION
3838
lang <- normalize_lang(pkg$language)
3939
} else {
40-
"en-US"
40+
lang <- suppressMessages(normalize_lang(NULL))
4141
}
4242
} else {
4343
lang <- normalize_lang(lang)
4444
}
4545

4646
# Add custom words to the ignore list
47+
4748
add_words <- if(isTRUE(use_wordlist))
48-
get_wordlist(path)
49+
unlist(strsplit(readLines(get_wordfile(path),
50+
warn = FALSE, encoding = "UTF-8"), " ",
51+
fixed = TRUE))
4952

5053
if (file.exists(file.path(path, "DESCRIPTION"))){
5154
pkg <- as_package(path)
@@ -99,3 +102,4 @@ spell_check_bookdown <- function(path = ".", lang = NULL, use_wordlist = TRUE){
99102

100103
summarize_words(all_sources, all_lines)
101104
}
105+

0 commit comments

Comments
 (0)