rstudio / htmltools

Tools for HTML generation and output
https://rstudio.github.io/htmltools/
215 stars 68 forks source link

find() can not find tag when it is only-one #329

Closed yikeshu0611 closed 1 year ago

yikeshu0611 commented 2 years ago
(html <- span("bar"))
tagQ <- tagQuery(html)
tagQ$find('span')

Result:

`$allTags()`:
<span>bar</span>

`$selectedTags()`: (Empty selection)

html is only one tag of span. So if I use find() to locate span tag, the result should be it self.

cpsievert commented 1 year ago

Thanks. We're aware of the confusion, and will likely fix this behavior. Closing here since this is essentially a duplicate of https://github.com/rstudio/htmltools/issues/334