I have a configuration value that represents a folder where some files are available for download. This value is a handlebars template:
"D:\{{identifier1}}\{{identifier2}}\SomeFolder\{{version}}"
This value is set per environment by our deploy server.
The problem is that when I run the template through like this:
var template = Handlebars.Compile(_configuration.FilePathFormat);
return template(new
{
identifier1 = 123,
identifier2 = 456,
version = "latest"
});
The result I get back is this:
R:{{identifier1}}{{identifier2}}\SomeFolder{{version}}
What I expect:
R:\123\456\SomeFolder\latest
For some reason it is escaping the handlebars and I don't want that. I have been unable to find anything on disabling escape characters, and no amount of slashes has worked to render the template correctly.
Also, if I put a space between the slash and the handlebar placeholder, it compiles and renders correctly, but then it has a space in the file path.
I found a site that let me test handlebars.js, but it behaves differently than handlebars.net