RegisterHelper with title "json" results in "Reached end of template..." error
With the following template and helper,
<div>
{{json AnyDataFromContext}}
</div>
Handlebars.RegisterHelper("json", ( writer, context, arguments ) =>
{
writer.Write("This will functionally break.");
});
the response will end in with the error: "Reached end of template before block expression was closed"
However, if i change both into the following (notice that the helper is no longer titled "json")
<div>
{{jsonXYZ AnyDataFromContext}}
</div>
Handlebars.RegisterHelper("jsonXYZ", ( writer, context, arguments ) =>
{
writer.Write("This functionally works.");
});
the result is
<div>
This functionally works.
</div>
I set up the test scenario you described above and it works for me as expected. Can you confirm the following so we can better troubleshoot:
- Is this is the exact template and helper you're using?
- What version of Handlebars.Net are you using?
- What platform/OS are you using?
Cannot replicate the issue anymore. Closing this issue.
An old issue, but I did have the same problem with a helper named "Math.Add".
Using Windows10, .NET Framework 4.5.1 and Handlebars.Net version 1.9.0.