Search code examples
rparsingtemplatesspecial-characters

How to disable HTML characters escaping in whisker.render in R


Package whisker

whisker.render("& Hello {{place}}", list("place" = "&World")) 

And the output is:

[1] "& Hello &World"

The question is: how to disable escaping HTML codes? So that the code above would produce:

[1] "& Hello &World"

Solution

  • Just use triple mustaches to prevent escaping.

    whisker.render("& Hello {{{ place }}}", list("place" = "&World"))