fix bugs before cran release
diff --git a/R/save_kable.R b/R/save_kable.R
index fe80d8f..c8b7185 100644
--- a/R/save_kable.R
+++ b/R/save_kable.R
@@ -188,7 +188,7 @@
output <- normalizePath(output)
template <- tempfile(fileext = ".html")
on.exit(unlink(template), add = TRUE)
- rmarkdown:::write_utf8("$body$", template)
+ write_utf8("$body$", template)
from <- if (rmarkdown::pandoc_available("1.17")) "markdown_strict" else "markdown"
rmarkdown::pandoc_convert(
input = input, from = from, output = output,
@@ -197,6 +197,13 @@
invisible(output)
}
+# Local version of rmarkdown:::write_utf8
+write_utf8 <- function (text, con, ...) {
+ opts <- options(encoding = "native.enc")
+ on.exit(options(opts), add = TRUE)
+ writeLines(enc2utf8(text), con, ..., useBytes = TRUE)
+}
+
remove_html_doc <- function(x){