Skip to content

Commit

Permalink
Don't show cell-output-display div when output: asis
Browse files Browse the repository at this point in the history
Follow up on #4703 and trying to solve #7600
  • Loading branch information
cderv authored and cscheid committed Dec 8, 2023
1 parent 56eb64d commit a3dc3b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/resources/rmd/hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ knitr_plot_hook <- function(format) {

# result = "asis" specific
if (identical(options[["results"]], "asis")) return(md)

# enclose in output div
output_div(md, NULL, classes)
}
Expand Down
3 changes: 3 additions & 0 deletions src/resources/rmd/patch.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ wrap_asis_output <- function(options, x) {
x <- paste0("`````{=html}\n", x, "\n`````")
}

# If asis output, don't include the output div
if (identical(options[["results"]], "asis")) return(x)

output_div(x, output_label_placeholder(options), classes, attrs)
}

Expand Down

0 comments on commit a3dc3b1

Please sign in to comment.