When a key has a . in, handlebars.net fails to find the key, even when escaping with [...]
using System;
using HandlebarsDotNet;
using Newtonsoft.Json.Linq;
namespace HandlebarsTester
{
public static class Program
{
internal static string Test(string template, string json)
{
var jObject = JObject.Parse(json);
var compiled = Handlebars.Compile(template);
var result = compiled.Invoke(jObject);
return result;
}
public static void Main(string[] args)
{
Console.WriteLine(Test("foo.bar: {{ [foo.bar] }}", "{ \"foo.bar\": \"FOO\" }"));
Console.ReadLine();
}
}
}
The above example prints: foo.bar: . The equivalent using handlebarsjs successfully renders this as foo.bar: FOO
When a key has a
.in, handlebars.net fails to find the key, even when escaping with[...]The above example prints:
foo.bar:. The equivalent using handlebarsjs successfully renders this asfoo.bar: FOO