commit | f2dfd14759a038dd9ec7b52e48728cc2be6e0f7e | [log] [tgz] |
---|---|---|
author | Hao Zhu <haozhu233@gmail.com> | Mon Jul 24 14:43:28 2017 -0400 |
committer | Hao Zhu <haozhu233@gmail.com> | Mon Jul 24 14:43:28 2017 -0400 |
tree | bb0551fe68c7f0eba41f930984e72017b8e111e8 | |
parent | 9eeb10bb9d9e3d94c55b218a03bfe2faa8559a2e [diff] [blame] |
solve the XML declaration problem
diff --git a/R/util.R b/R/util.R index e576ef4..9d4146e 100644 --- a/R/util.R +++ b/R/util.R
@@ -71,3 +71,11 @@ return(x) } +as_kable_xml <- function(x) { + tmp <- tempfile(fileext = ".xml") + write_xml(x, tmp, options = "no_declaration") + out <- readLines(tmp) + out <- paste(out, collapse = "\n ") + out <- structure(out, format = "html", class = "knitr_kable") + return(out) +}