Skip to content

Commit 864dbd7

Browse files
committed
source ojs_define directly in the tool environment
1 parent a2fc713 commit 864dbd7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/resources/rmd/execute.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ execute <- function(input, format, tempDir, libDir, dependencies, cwd, params, r
167167
!is_shiny_prerendered(knitr::opts_knit$get("rmarkdown.runtime")) &&
168168
needs_ojs
169169
) {
170-
local({
171-
# source ojs_define() function and save it in the tools environment
172-
source(file.path(resourceDir, "rmd", "ojs_static.R"), local = TRUE)
173-
assign("ojs_define", ojs_define, envir = .quarto_tools_env)
174-
})
170+
# source ojs_define() function into the tools environment
171+
source(
172+
file = file.path(resourceDir, "rmd", "ojs_static.R"),
173+
local = .quarto_tools_env
174+
)
175175
}
176176

177177
# special internal function for rendering inline code using Quarto syntax

0 commit comments

Comments
 (0)