Closed groue closed 10 months ago
I agree that precise control over rendering would be a general improvement and position Mustache more firmly as a general purpose templating solution rather than an HTML orientated one.
{{{ ... }}}
is offered as a solution for preventing escaping. However, in a non HTML scenario the use of the {{{ ... }}}
becomes mandatory. For example: A safely templated AppleScript dictionary (aka record in AS) assignment requires:
-- compute myResult
set myResult to { {{{ task-input-variables }}} }
Another issue is that when rendering non HTML content (say AppleScript) a failure to utilise {{{...}}}
religiously can result in the somewhat distracting and syntax breaking appearance of one language characteristic (HTML) in the midst of another (AppleScript).
The CONTENT_TYPE proposal seems well positioned. The pragma paradigm is backwards compatible and extensible. The suggested default behaviour seems sensible.
For the record, GRMustache 6.2 has shipped with support for text templates (documentation).
+1
+1
There is a need for totally disabling HTML-escaping, and have {{name}} render just as {{{name}}}:
Currently proposed solutions fall in one of those two buckets:
After a study of the topic for GRMustache, here is more food for thoughts:
{{% CONTENT_TYPE:TEXT }}
and{{% CONTENT_TYPE:HTML }}
.