Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Allow users to override mustache syntax for conflicting template systems #192

Open
ebidel opened this issue Oct 3, 2014 · 1 comment
Open

Comments

@ebidel
Copy link
Contributor

ebidel commented Oct 3, 2014

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

@addyosmani
Copy link

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 }}")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants