rip747 / Mustache.cfc

{{ mustache }} for ColdFusion
http://mustache.github.com/
MIT License
46 stars 22 forks source link

Support for changing or escaping delimiters #30

Open davemerrill opened 8 years ago

davemerrill commented 8 years ago

Wondering how to handle the (unlikely but possible) case where {{ or }} is needed in a template.

As I understand it, Mustache supports this syntax to change delimiters before compiling:

Mustache.tags = ["[[", "]]"];

It also supports changing delimiters on the fly like this:

{{=<% %>=}}

Far as I can see, neither of those variants are supported by MustacheCFC. Am I right about that? If so, could they be, or are there other alternatives?

dswitzer commented 8 years ago

The way the current parser works it relies on regex parser to find tokens that need processing. Adding support for custom delimiters could probably be done w/out too much work, but allowing for templates to set the delimiters might be more problematic.

I'd certainly have no objects to someone submitting a pull request to add the functionality.

davemerrill commented 8 years ago

Thanks Dan, all what I guessed. Don't have an immediate need for this now, just exploring what would be required if someone asks.