Skip to content

Commit

Permalink
fixing issue with quoting the string.
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikeya committed Sep 21, 2023
1 parent 6a24d44 commit 4653580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/Renderer.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Renderer <- R6::R6Class( # nolint: object_name_linter.
"\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(%s)\n%s\n```\n",
capture.output(dput(global_knitr)),
if (identical(private$report_type, "powerpoint_presentation")) {
paste(capture.output(code_block_function), collapse = "\n")
paste0("code_block <- ", paste(deparse(format_code_block_for_slide), collapse = "\n"))
} else {
character(0)
}
Expand Down Expand Up @@ -132,7 +132,7 @@ Renderer <- R6::R6Class( # nolint: object_name_linter.
paste(
sprintf(
"---\n\n```{r, echo=FALSE}\ncode_block(\n%s)\n```\n",
shQuote(block_content_lst)
sQuote(block_content_lst, q = FALSE)
),
collapse = "\n\n"
)
Expand Down
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ to_flextable <- function(content) {
#'
#' @keywords internal
custom_theme <- function(ft) {
checkmate::assert_class(ft, "flextable")
ft <- flextable::fontsize(ft, size = 8, part = "body")
ft <- flextable::bold(ft, part = "header")
ft <- flextable::theme_booktabs(ft)
Expand Down Expand Up @@ -267,7 +268,7 @@ split_text_block <- function(x, n) {
#' @noRd
#'
#' @keywords internal
code_block_function <- function(code_block) {
format_code_block_for_slide <- function(code_block) {
df <- data.frame(code_block)
ft <- flextable::flextable(df)
ft <- flextable::delete_part(ft, part = "header")
Expand Down

0 comments on commit 4653580

Please sign in to comment.