janl/mustache.js — pull request #183 by cweider (2012-03-09 07:45:13+00:00)
Title: Strict escape

This Mustache interpreter avoids escaping the `&` character of substrings that look like HTML entities (see #19). AFAIK, other Mustaches are less forgiving and sometimes this behavior is desirable (if, say, the body of this message was provided as template data).

Ruby’s [mustache](https://github.com/defunkt/mustache) gives:

```ruby
>> Mustache.to_html "{{amp}}", :amp => "&"
=> "&amp;"
```

This patch allows an escaping method to be injected (via exports) and provides strict and fanatic escaping methods. Discuss…