rstudio / htmltools

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

Add `tagQuery()` `$matches(cssSelector)` functionality #350

Open schloerke opened 1 year ago

schloerke commented 1 year ago

After another discussion, tagQuery() will add a method like $matches() similar to a vectorized form of Element.matches(cssSelector).

No alterations will be made to tagAppendAttributes(). Users can use $matches() to help determine their desired behavior in two steps.

Originally posted by @schloerke in https://github.com/rstudio/htmltools/issues/334#issuecomment-1298890730


Should there also be the tag** helper method? tagMatches(x, cssSelector)?

cc @cpsievert