diff --git a/R/Renderer.R b/R/Renderer.R index 94072b51..6a4e6bee 100644 --- a/R/Renderer.R +++ b/R/Renderer.R @@ -34,10 +34,6 @@ Renderer <- R6::R6Class( # nolint: object_name_linter. yaml_header <- md_header(yaml::as.yaml(list(title = "Report"))) } - if (requireNamespace("formatR", quietly = TRUE)) { - global_knitr[["tidy"]] <- TRUE - } - private$report_type <- get_yaml_field(yaml_header, "output") format_code_block_function <- paste0( c( diff --git a/R/zzz.R b/R/zzz.R index 62f39049..e0876fe2 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -4,7 +4,7 @@ default_global_knitr <- list(teal.reporter.global_knitr = list( echo = TRUE, tidy.opts = list(width.cutoff = 60), - tidy = FALSE + tidy = requireNamespace("formatR", quietly = TRUE) )) if (!("teal.reporter.global_knitr" %in% names(op))) {