adding some checks to disable the real-time display when RStudio is not running
diff --git a/R/kableExtra-package.R b/R/kableExtra-package.R
index b0a3fcc..c556076 100644
--- a/R/kableExtra-package.R
+++ b/R/kableExtra-package.R
@@ -71,6 +71,7 @@
#' @importFrom viridisLite viridis
#' @importFrom stats ave
#' @importFrom grDevices col2rgb
+#' @importFrom rstudioapi isAvailable viewer
#' @import htmltools
#' @name kableExtra-package
#' @aliases kableExtra
diff --git a/R/print.R b/R/print.R
index eb006de..13e8568 100644
--- a/R/print.R
+++ b/R/print.R
@@ -7,8 +7,9 @@
)
html_table <- htmltools::HTML(as.character(x))
html_result <- htmltools::tagList(html_header, html_table)
- htmltools::html_print(html_result)
-
+ if (interactive & rstudioapi::isAvailable()) {
+ htmltools::html_print(html_result, viewer = rstudioapi::viewer)
+ }
print(html_result)
}