mojombo/mustache.erl — comment on commit a7baff1630d9b06de05f1d3a7a5a08041dcc743b
File:  line 0
By klaar:

Pretty cool when a one line patch that you barely remember writing reappears and wreaks havok. I took a trip down nostalgia lane and isolated it to https://github.com/mojombo/mustache.erl/blob/a7baff1630d9b06de05f1d3a7a5a08041dcc743b/src/mustache.erl#L116

When i wrote this I never did find that second level of brokenness that was the reason for converting everything except booleans to strings. Basically the generated code relies on the side effect of mustache:get converting the return value to a string when this is convenient, when you want to output a value. At the same time it relies on mustache:get not converting booleans when that's convenient, when you want to use a value in a block when it expects true, false or a list of dictionaries. These two expectations on the behavior of mustache:get conflicts.

The quick fix for this is to update line 116 and line 118 to match on the strings "true" and "false" instead of the atoms true and false.