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

Boolean attributes in script tag not rendered correctly #197

Closed
cpsievert opened this issue Jan 15, 2021 · 1 comment
Closed

Boolean attributes in script tag not rendered correctly #197

cpsievert opened this issue Jan 15, 2021 · 1 comment

Comments

@cpsievert
Copy link
Collaborator

cpsievert commented Jan 15, 2021

In #188, we added the ability to specify <script> attributes with a list of values. However, it doesn't seem to support boolean attribites in the same way as other tags (i.e., div(foo=NA) gets rendered as <div foo></div>).

For example:

library(htmltools)
dep <- htmlDependency(
  "foo", "1.0",
  src = list(href = "foo/"),
  script = list(src = "my.js", defer = NA)
)
renderDependencies(list(dep))
#> <script src="foo/my.js" defer="NA"></script>

BTW, the above seems to work in Chrome/Firefox, but it really should be rendered as

#> <script src="foo/my.js" defer></script>
@cpsievert
Copy link
Collaborator Author

Closed by #201

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 a pull request may close this issue.

1 participant