barc/express-hbs — pull request #61 by JonathanO (2014-05-12 20:13:44+00:00)
Title: Escape the result of async handlers if {{...}} used.

Escape async handler results if {{...}} is used, but not escape if {{{...}}} is used.
Brings behaviour in line with other Handlebars behaviour.
Resolves issue #59
This is potentially breaking backwards compatibility if anyone was relying on {{...}} with async helpers not escaping.

This relies on the aSyNcId placeholder containing a character that will be escaped if {{...}} was used. This basically gives us two placeholders to replace, one that has a < in it (and thus must have been in a {{{...}}} since it was not escaped), and the other that has a < in it (and thus must have been in a {{...}})

I can't see an obviously nicer way to fix this, sadly.