rip747/Mustache.cfc — pull request #4 by dswitzer (2012-04-04 21:30:14+00:00)
Title: Added better whitespace handling, support for dot notation, etc

I wanted to pass back some of the mods I've been making to the Mustache.cfc. We needed support for dot notation (which is now part of the spec) so I added support for it.

I also wanted better whitespace management, that worked closer to what the other Mustache implementation I've seen. This version doesn't produce blank lines for blocks that aren't executed or during array/query segments between each line.

I also added an example (MustacheFormatter) on how you could extend the language to do additional render logic. In this example, I've implemented a Ctemplate-style formatter.

Using the MustacheFormatter version of the CFC, you could do something like:

{{name:upperCase()}}

To format the "name" variable so it's all in upper case.

I have some additional code re-arrangement I'm planning (I'm going to move all the variables into a "Mustache" namespace--that way it doesn't collide with other variables when your extending the base Mustache.cfc,) but I wanted to get you these changes before I changed it too much more.