Wuvist/mustache — pull request #1 by huntaub (2013-12-31 23:15:03+00:00)
Title: Fixed Issue with Nested Lambdas in Repeated Sections

I was experiencing an issue with Lambdas nested in Repeated Sections (they were not being passed the inner text on the second time that the section was rendered).

Example

Template:

{{#list}}
{{#_}}test{{/_}}{{.}}
{{/list}}

Data:

map[string]interface{}{
"_": func(s string)string { return s + "h" },
"list": []int{0,1},
}

Current (incorrect) output (no whitespace):

testh0h1

Expected output (no whitespace):

testh0testh1

I believe the problem comes from the fact that you overwrite the current section elements after executing the Lambda. I have edited this function so that the Lambda immediately renders its output then returns. **This passes all of the provided tests** - but let me know if it looks like it will break something in a major way.

Thanks!