Skip to content

Commit

Permalink
Pass user-supplied calling handlers to evaluate()
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jan 5, 2019
1 parent caf83fb commit 61c17f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: knitr
Type: Package
Title: A General-Purpose Package for Dynamic Report Generation in R
Version: 1.21.6
Version: 1.21.6.9000
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
person("Adam", "Vogt", role = "ctb"),
Expand Down Expand Up @@ -101,7 +101,7 @@ Description: Provides a general-purpose tool for dynamic report generation in R
Depends:
R (>= 3.1.0)
Imports:
evaluate (>= 0.10),
evaluate (>= 0.11.1.9000),
highr,
markdown,
stringr (>= 0.6),
Expand Down Expand Up @@ -131,6 +131,8 @@ Suggests:
showtext,
tibble,
styler
Remotes:
lionel-/evaluate@add-calling-handlers
License: GPL
URL: https://yihui.name/knitr/
BugReports: https://github.com/yihui/knitr/issues
Expand Down
9 changes: 6 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,12 @@ knit_handlers = function(fun, options) {
if (length(formals(fun)) < 2)
stop("the chunk option 'render' must be a function of the form ",
"function(x, options) or function(x, ...)")
merge_list(default_handlers, list(value = function(x, visible) {
if (visible) fun(x, options = options)
}))
merge_list(default_handlers, list(
value = function(x, visible) {
if (visible) fun(x, options = options)
},
calling_handlers = options$calling.handlers
))
}

# conditionally disable some features during R CMD check
Expand Down

0 comments on commit 61c17f5

Please sign in to comment.