Skip to content

Commit

Permalink
split_lines() has been in xfun since v0.12 (Jan 2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Jun 23, 2020
1 parent 27dfd68 commit 2e08d5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.29
Version: 1.29.1
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Adam", "Vogt", role = "ctb"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# CHANGES IN knitr VERSION 1.30



# CHANGES IN knitr VERSION 1.29

## NEW FEATURES
Expand Down
8 changes: 1 addition & 7 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,7 @@ read_rforge = function(path, project, extra = '') {
read_utf8(sprintf('%s/%s?root=%s%s', base, path, project, extra))
}

# TODO: just import xfun::split_lines()
split_lines = function(x) {
if (length(grep('\n', x)) == 0L) return(x)
x = gsub('\n$', '\n\n', x)
x[x == ''] = '\n'
unlist(strsplit(x, '\n'))
}
split_lines = function(x) xfun::split_lines(x)

# if a string is encoded in UTF-8, convert it to native encoding
native_encode = function(x, to = '') {
Expand Down

0 comments on commit 2e08d5a

Please sign in to comment.