epoxy icon indicating copy to clipboard operation
epoxy copied to clipboard

`epoxy_style_html()`: Support attribute syntax

Open gadenbuie opened this issue 2 years ago • 1 comments

Currently, epoxy_style_html() supports id and class attributes, but we could support additional attributes with something like this:

{{ a(href="https://example.com") link_text }}

In the long run, it'd be nice to be able to nest replacements, e.g.

{{ a(href="{{ link_url }}") link_text }}

or

{{ a href=link_url link_text }}

or maybe

{{ a c(href = link_url, link_text) }}

gadenbuie avatar Jun 01 '22 01:06 gadenbuie

I need to pick an easier to parse syntax, either:

{{ a(href="https://example.com") link_text }}

or

{{ a href=link_url {{ link_text }} }}

or

{{ <a href="https://example.com"> link_text }}

The last one would allow a.class#id but to use named attributes, you'd need to write out <a name="value">.

gadenbuie avatar Aug 28 '22 12:08 gadenbuie

I've decided not to follow through with this. Use inline formatters or switch to the whisker engine or use ui_epoxy_mustache() in Shiny.

gadenbuie avatar Apr 02 '23 13:04 gadenbuie