I actually did this work a while back, but I'm just now getting back to this code. I've implemented a couple of patches I thought worthy of migrating back into the source:
Added basic support for implicit iterators (i.e. {{.}} for arrays.) This means you can now access an array using the following: {{#array}} array value: {{.}} {{/array}}
Separated the functions for encoding the {{ }} and {{{ }}} evaluated text. I did this so someone has the ability to overwrite the behavior of {{...}} and {{{...}}}. For our use case, we need to explicit handle how text is rendered based upon how it's being used in the code (we're using Mustache to give our users some templating processing abilities for e-mail generation.) So if we're rendering an HTML e-mail, we always want to html encode the text and likewise for text e-mails we always want to render the text as-is.
I actually did this work a while back, but I'm just now getting back to this code. I've implemented a couple of patches I thought worthy of migrating back into the source:
{{#array}} array value: {{.}} {{/array}}
{{ }}
and{{{ }}}
evaluated text. I did this so someone has the ability to overwrite the behavior of{{...}}
and{{{...}}}
. For our use case, we need to explicit handle how text is rendered based upon how it's being used in the code (we're using Mustache to give our users some templating processing abilities for e-mail generation.) So if we're rendering an HTML e-mail, we always want to html encode the text and likewise for text e-mails we always want to render the text as-is.