What
When the template contains a double backslash. The result only contains a single backslash.
Reproduction
To reproduce I wrote the following unit test:
[TestMethod]publicvoidCompile_WithDoubleBackslashes_ReturnsExpectedString(){stringtemplate=@"\\";varcompiledTemplate=Handlebars.Compile(template);stringresult=compiledTemplate(null);Assert.AreEqual(@"\\",result);}It fails with message:
Assert.AreEqual failed. Expected:<\\>. Actual:<\>.
Here I would expect that the result string contains the double backslash.
Workaround
To workaround this issue I can change the template to string template = @"\\\\".
What
When the template contains a double backslash. The result only contains a single backslash.
Reproduction
To reproduce I wrote the following unit test:
It fails with message:
Assert.AreEqual failed. Expected:<\\>. Actual:<\>.Here I would expect that the result string contains the double backslash.
Workaround
To workaround this issue I can change the template to
string template = @"\\\\".