Skip to content

Commit

Permalink
fix: flextable_to_rmd() issue with local chunk eval option
Browse files Browse the repository at this point in the history
fix #631
  • Loading branch information
davidgohel committed Aug 14, 2024
1 parent 0603608 commit b03d310
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: flextable
Title: Functions for Tabular Reporting
Version: 0.9.7.007
Version: 0.9.7.008
Authors@R: c(
person("David", "Gohel", , "[email protected]", role = c("aut", "cre")),
person("ArData", role = "cph"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
rmarkdown (issue #632)
- fix right outer border issue in grid format (issue #650)
- fix `flextable_to_rmd()` issue with images in pdf (issue #651)
- fix `flextable_to_rmd()` issue with local chunk `eval` option (issue #631)

# flextable 0.9.6

Expand Down
9 changes: 6 additions & 3 deletions R/printers.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ flextable_to_rmd <- function(x, ...) {
x <- knitr_update_properties(x, bookdown = is_bookdown, quarto = is_quarto)

if (is_quarto) {
tmp_file <- tempfile(fileext = ".Rmd")
} else {
tmp_file <- tempfile(fileext = ".qmd")
} else {
tmp_file <- tempfile(fileext = ".Rmd")
}

writeLines(
Expand All @@ -105,7 +105,10 @@ flextable_to_rmd <- function(x, ...) {

z <- knit_child(
input = tmp_file,
options = list(fig.path=tempfile()),
options = list(
fig.path=tempfile(),
eval = isTRUE(knitr::opts_current$get("eval"))
),
envir = environment(), quiet = TRUE)

cat(z, sep = '\n')
Expand Down

0 comments on commit b03d310

Please sign in to comment.