Document how to add an empty attribute
Closed this issue · 1 comments
russHyde commented
In tagAppendAttributes(), could we add an example to show how to add an empty attribute please.
The current examples are:
html <- div(a())
tagAppendAttributes(html, class = "foo")
<div class="foo">
<a></a>
</div>
tagAppendAttributes(html, .cssSelector = "a", class = "bar")
<div>
<a class="bar"></a>
</div>
tagHasAttribute(div(foo = "bar"), "foo")
[1] TRUE
tagGetAttribute(div(foo = "bar"), "foo")
[1] "bar"
So, could we add an example like:
tagAppendAttributes(html, `value-attribute` = 123, `empty-attribute` = NA)
<div value-attribute="123" empty-attribute>
<a></a>
</div>
How to construct empty/flag attributes doesn't appear to be documented anywhere.
gadenbuie commented