Open ebidel opened 9 years ago
In Underscore/Lodash, the template settings allow you to define an interpolate regex to match expressions, effectively supporting customization similar to the above. Are you looking for that kind of power, or just the ability to change the token deliminators outright (e.g tokenStart='[['
, tokenEnd=']]'
)? Either way, I think this is worth supporting as it's likely to come up increasingly over the next year or two.
IIRC, Underscore just does:
// e.g for {{-
_.templateSettings.escape = /\{\{-(.*?)\}\}/g
compiled = _.template("Escaped: {{- value }}\nNot escaped: {{ value }}")
AFAICT, there's no way for users to override the mustaches with another token, say
{{{}}}
. This comes up where{{}}
conflicts with other templating systems.From http://stackoverflow.com/questions/26173604/using-polymer-templates-in-tumblr-themes