Skip to content

Conversation

@AmeliaMN
Copy link
Contributor

in the absence of htmlwidgets

To fix #263

R/view.R Outdated
)
html <- htmltools::HTML(bullets)

if(!requireNamespace("htmlwidgets", quietly = TRUE)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use styler to restyle this block? (You're missing a few spaces)

R/view.R Outdated
html <- htmltools::HTML(bullets)

if(!requireNamespace("htmlwidgets", quietly = TRUE)){
message("htmlwidgets package required for str_view(). \nPlease install.packages(\"htmlwidgets\") to use this functionality.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and this should be a stop, and hence you don't need the else block

R/view.R Outdated
html <- htmltools::HTML(bullets)

if (!requireNamespace("htmlwidgets", quietly = TRUE)) {
stop("htmlwidgets package required for str_view(). \nPlease install.packages(\"htmlwidgets\") to use this functionality.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add call. = FALSE?

@hadley hadley merged commit 2dd63d7 into tidyverse:master Jan 19, 2019
@hadley
Copy link
Member

hadley commented Jan 19, 2019

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail more gracefully when str_view() is called in the absence of htmlwidgets

2 participants