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

Render user custom html for widget. #240

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion R/htmlwidgets.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ widget_html <- function(name, package, id, style, class, inline = FALSE, ...){

# call the custom function if we have one, otherwise create a div
if (is.function(fn)) {
fn(id = id, style = style, class = class, ...)
renderTags(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if this is the right fix. It might rather be to surround the results of the function in an html-preserve comment (which will also prevent pandoc from touching it). @jcheng5 What's the best thing here?

fn(id = id, style = style, class = class, ...)
)
} else if (inline) {
tags$span(id = id, style = style, class = class)
} else {
Expand Down