fix #517 and #518, empty data and empty img tags
- return NULL if x is empty/null, no need to try to plot something
- check for this NULL when saving to html or latex
diff --git a/R/column_spec.R b/R/column_spec.R
index 25d1289..14c0ea1 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -264,7 +264,7 @@
extra_css)
}
- if (!is.null(image)) {
+ if (!is.null(image) && (length(image) > 1 || !is.null(image[[1]]))) {
image <- image[[1]]
if (inherits(image, "kableExtraInlinePlots")) {
if (!is.null(image$svg_text)) {
@@ -539,7 +539,7 @@
new_row[column], "\\}")
}
- if (!is.null(image)) {
+ if (!is.null(image) && (length(image) > 1 || !is.null(image[[1]]))) {
image <- image[[1]]
if (inherits(image, "kableExtraInlinePlots")) {
new_row[column] <- paste0(