I have already created a pull request for you to include that has unit test setup to showcase the error.
#348
Essentially the issue is that when using json like the following:
{"Description":"**\\*.{{Thing.Name}}"}
After running the template through compile:
`var json = new TestJSONObject()
{
Name = "Thing - {{Thing.Name}}",
Description = "**\*.{{Thing.Name}}",
Test = new TestJSONObject()
{
Test = new TestJSONObject()
{
Name = ""{{Thing.Name}}""
}
}
};
var source = JsonConvert.SerializeObject(json);
var template = Handlebars.Compile(source);
var data = new
{
Thing = new
{
Name = "Handlebars.Net"
}
};
var result = template(data);`
The result comes out with:
{"Description":"**\*.Handlebars.Net"}
And then if i try to parse that json back into object:
var resultJson = JsonConvert.DeserializeObject<TestJSONObject>(result);
An error is thrown because '*' is not a valid escape character:
'Bad JSON escape sequence: \*. Path 'Description', line 1, position 20.'
I have already created a pull request for you to include that has unit test setup to showcase the error.
#348
Essentially the issue is that when using json like the following:
{"Description":"**\\*.{{Thing.Name}}"}After running the template through compile:
`var json = new TestJSONObject()
{
Name = "Thing - {{Thing.Name}}",
Description = "**\*.{{Thing.Name}}",
Test = new TestJSONObject()
{
Test = new TestJSONObject()
{
Name = ""{{Thing.Name}}""
}
}
};
The result comes out with:
{"Description":"**\*.Handlebars.Net"}And then if i try to parse that json back into object:
var resultJson = JsonConvert.DeserializeObject<TestJSONObject>(result);An error is thrown because '*' is not a valid escape character:
'Bad JSON escape sequence: \*. Path 'Description', line 1, position 20.'