gadenbuie / epoxy

Extra-strength glue engines for R Markdown, Quarto, and Shiny
https://pkg.garrickadenbuie.com/epoxy/
Other
212 stars 10 forks source link

Should `epoxy_transform_html()` collapse to single string? #96

Closed gadenbuie closed 1 year ago

gadenbuie commented 1 year ago

I remember having reasons why I switched away from this – likely due to an interaction with the inline transformer – but this doesn't feel right:

library(epoxy)
epoxy_html("<ul>{{li letters[1:3]}}<ul>")
<ul><li>a</li><ul>
<ul><li>b</li><ul>
<ul><li>c</li><ul>
gadenbuie commented 1 year ago

I switched here: https://github.com/gadenbuie/epoxy/commit/126d27cc45f7dd531db19162fd1dc0a2f353d802

I'm fairly certain I was working on getting the right semantics for the html > inline transformers.

I think it'll be a lot better in most cases to have the inline html transformation return a single character string, but I'll make it optional with a collapse argument.

I also realized that it's important that the inline transformers for epoxy_transform_inline(), e.g. for .strong or .emph, must also return a vector of html characters and this is likely why I thought I needed to change the original behavior of epoxy_html().