Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using evaluate internals #2353

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,9 @@ knit_print.knit_asis_url = function(x, ...) x

#' @rdname knit_print
#' @export
normal_print = default_handlers$value
formals(normal_print) = alist(x = , ... = )
normal_print = function(x, ...) {
if (isS4(x)) methods::show(x) else print(x)
}

#' Mark an R object with a special class
#'
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ current_input = function(dir = FALSE) {
if (is_abs_path(input)) input else file.path(outwd, input)
}

# import output handlers from evaluate
default_handlers = evaluate:::default_output_handler
# cache output handlers from evaluate; see .onLoad
default_handlers = NULL
# change the value handler in evaluate default handlers
knit_handlers = function(fun, options) {
if (!is.function(fun)) fun = function(x, ...) {
Expand Down
2 changes: 2 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.onLoad = function(lib, pkg) {
register_vignette_engines(pkg)

default_handlers <<- evaluate::new_output_handler()
}
Loading