Skip to content
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
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ Imports:
htmltools (>= 0.5.7),
jsonlite (>= 0.9.16),
knitr (>= 1.8),
rmarkdown,
rlang (>= 1.0.0),
yaml
Suggests:
rmarkdown,
testthat
Comment thread
cpsievert marked this conversation as resolved.
Enhances:
shiny (>= 1.1)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# htmlwidgets (development version)

* Moved `{rmarkdown}` from `Imports` to `Suggests`. It's now only required when calling `saveWidget(selfcontained = TRUE)`. (#455)

* htmlwidgets hex sticker added

* Static widget resize detection now uses `ResizeObserver` instead of `window.resize`, Bootstrap tab/collapse, and ioslides event listeners. This enables widgets to detect container-level size changes (e.g., CSS-driven resizing, sidebar toggles, flexbox/grid layout changes) that were previously missed. (#496)
Expand Down
7 changes: 6 additions & 1 deletion R/pandoc.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
write_md_for_pandoc <- function(html, file, background = "white", title, libdir = "lib", use_raw_attr = rmarkdown::pandoc_available("2.0")) {
write_md_for_pandoc <- function(html, file, background = "white", title, libdir = "lib", use_raw_attr = NULL) {
rlang::check_installed("rmarkdown")
if (is.null(use_raw_attr)) {
use_raw_attr <- rmarkdown::pandoc_available("2.0")
}
# Forked from htmltools::save_html to work better with pandoc_self_contained_html

# ensure that the paths to dependencies are relative to the base
Expand Down Expand Up @@ -60,6 +64,7 @@ write_md_for_pandoc <- function(html, file, background = "white", title, libdir
# The input should be the path to a file that was created using pandoc_save_markdown
pandoc_self_contained_html <- function(input, output) {

rlang::check_installed("rmarkdown")
if (!rmarkdown::pandoc_available()) {
stop(
"Saving a widget with selfcontained = TRUE requires pandoc. ",
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-pandoc.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("Fix for issue #358 works", {
skip_if_not_installed("rmarkdown")
skip_if_not(
rmarkdown::pandoc_available(),
"Test requires pandoc to be installed"
Expand Down
Loading