Merge pull request #579 from vincentarelbundock/mirror_styling
kable_meta detects table_env
diff --git a/R/column_spec.R b/R/column_spec.R
index c947573..5ca4251 100644
--- a/R/column_spec.R
+++ b/R/column_spec.R
@@ -279,7 +279,7 @@
}
if (!is.null(extra_css)) {
xml_attr(target_cell, "style") <- paste0(xml_attr(target_cell, "style"),
- extra_css)
+ enc2utf8(extra_css))
}
if (!is.null(image) && (length(image) > 1 || !is.null(image[[1]]))) {
@@ -303,13 +303,13 @@
# favor popover over tooltip
if (!is.null(popover)) {
if (!inherits(popover, "ke_popover")) popover <- spec_popover(popover)
- popover_list <- attr(popover, 'list')
+ popover_list <- lapply(attr(popover, 'list'), enc2utf8)
for (p in names(popover_list)) {
xml_attr(target_cell, p) <- popover_list[p]
}
} else if (!is.null(tooltip)) {
if (!inherits(tooltip, "ke_tooltip")) tooltip <- spec_tooltip(tooltip)
- tooltip_list <- attr(tooltip, 'list')
+ tooltip_list <- lapply(attr(tooltip, 'list'), enc2utf8)
for (t in names(tooltip_list)) {
xml_attr(target_cell, t) <- tooltip_list[t]
}
diff --git a/R/row_spec.R b/R/row_spec.R
index ea96971..60d2a7c 100644
--- a/R/row_spec.R
+++ b/R/row_spec.R
@@ -175,7 +175,7 @@
"deg);")
}
if (!is.null(extra_css)) {
- xml_attr(x, "style") <- paste0(xml_attr(x, "style"), extra_css)
+ xml_attr(x, "style") <- paste0(xml_attr(x, "style"), enc2utf8(extra_css))
}
return(x)
}