I have a template fragment that looks like this:
<#+
if (length == "0")
#> return record.Substring(offset);
<#+
else
#> return record.Substring(offset, <#= length #>);
When length != "0" it works fine, but when it is "0" it emits the record.Substring(offset); code ok but is then followed by the text "0);" (without the double-quotes) on the next line. It looks like it is emitting the fragment "<#= length #>);" from the else block. I don't understand why?