Fixed a bug caused by readLines
diff --git a/R/kableExtra-package.R b/R/kableExtra-package.R
index 4b89362..6dd0514 100644
--- a/R/kableExtra-package.R
+++ b/R/kableExtra-package.R
@@ -61,7 +61,7 @@
#' @importFrom rmarkdown latex_dependency
#' @importFrom magrittr %>%
#' @importFrom utils read.csv
-#' @importFrom readr read_lines
+#' @importFrom readr read_lines read_file
#' @name kableExtra-package
#' @aliases kableExtra
#' @docType package
diff --git a/R/util.R b/R/util.R
index 40dab5e..87f72c8 100644
--- a/R/util.R
+++ b/R/util.R
@@ -74,8 +74,7 @@
as_kable_xml <- function(x) {
tmp <- tempfile(fileext = ".xml")
write_xml(x, tmp, options = "no_declaration")
- out <- readLines(tmp, warn = FALSE)
- out <- paste(out, collapse = "\n")
+ out <- read_file(tmp)
out <- structure(out, format = "html", class = "knitr_kable")
return(out)
}