epoxy_html("{{ li letters[1:3] }}")
epoxy_html("{{ li.alpha letters[1:3] }}")
epoxy_html("{{ li#my-letter letters[7] }}")
# The default element is used if no element is directly requested
epoxy_html("My name starts with {{ .name-letter letters[7] }}")
epoxy_html(
"{{ h3#title title }}",
title = "Epoxy for HTML"
)
# If your replacement text contains HTML, it's escaped by default.
hello <- "Hi there!"
epoxy_html("{{ hello }}")
# You can use !! inline to mark the text as safe HTML...
epoxy_html("{{ !!hello }}")
epoxy_html("{{ button !!hello }}")
# ...or you can use htmltools::HTML() to mark it as safe HTML in R.
hello <- htmltools::HTML("Hi there!")
epoxy_html("{{ hello }}")
Run the code above in your browser using DataLab