Skip to content

Commit 8def7bb

Browse files
committed
add figure captioning support for shiny.tag/shiny.tag.list objects
1 parent 11ddfc6 commit 8def7bb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

R/output.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ wrap.knit_asis = function(x, options, inline = FALSE) {
465465
# store metadata in an object named of the form .hash_meta when cache=TRUE
466466
if (length(m) && options$cache == 3)
467467
assign(cache_meta_name(options$hash), m, envir = knit_global())
468-
if (inherits(x, 'knit_asis_htmlwidget')) {
468+
if (inherits(x, c('knit_asis_htmlwidget', 'knit_asis_shiny_tag'))) {
469469
options$fig.cur = plot_counter()
470470
options = reduce_plot_opts(options)
471471
return(add_html_caption(options, x))

R/utils.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ knit_handlers = function(fun, options) {
752752
# the figure caption to it later in wrap.knit_asis
753753
if (inherits(x, 'htmlwidget'))
754754
class(res$value) = c(class(res$value), 'knit_asis_htmlwidget')
755+
if (inherits(x, c('shiny.tag', 'shiny.tag.list')))
756+
class(res$value) = c(class(res$value), 'knit_asis_shiny_tag')
755757
if (res$visible) res$value else invisible(res$value)
756758
}
757759
if (length(formals(fun)) < 2)

0 commit comments

Comments
 (0)