You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I read above data from a file and put it as a single string into handlebars.compileInline() function and then provide context with values for src_folder and src_subfolder to template.apply call
I get correct output with both parameters resolved on line 1
I get expected behavior on line 2 with only first parameter resolved and then escaped value of {{src_subfolder}}
Problem occurs on line 3, where it gives same result as on line 2 with single \ and {{src_subfolder}} string.
I expect it to be both parameters resolved with single \ in between
Tried with 4.1.2 and 4.0.7 versions
If I try it online at http://tryhandlebarsjs.com/
I get the behavior I expect for line 3 (line 1 & 2 are same as for handlebars.java)
Simple java main function I used to test this (file1.handlebars contains example data above):
Hi,
Have a issue with trying to get handlebar template to work in generating correct output for windows paths.
Example:
testline1: {{src_folder}} {{src_subfolder}}
testline2: {{src_folder}}{{src_subfolder}}
testline3: {{src_folder}}\{{src_subfolder}}
If I read above data from a file and put it as a single string into handlebars.compileInline() function and then provide context with values for src_folder and src_subfolder to template.apply call
I get correct output with both parameters resolved on line 1
I get expected behavior on line 2 with only first parameter resolved and then escaped value of {{src_subfolder}}
Problem occurs on line 3, where it gives same result as on line 2 with single \ and {{src_subfolder}} string.
I expect it to be both parameters resolved with single \ in between
Tried with 4.1.2 and 4.0.7 versions
If I try it online at http://tryhandlebarsjs.com/
I get the behavior I expect for line 3 (line 1 & 2 are same as for handlebars.java)
Simple java main function I used to test this (file1.handlebars contains example data above):
public static void main(String[] args) throws Exception {
System.out.println("Output testjknack");
Map<String, Object> bundle = new HashMap<String, Object>();
bundle.put("src_folder", "folder");
bundle.put("src_subfolder", "subfolder");
Context context = Context
.newBuilder(bundle)
.resolver(
MapValueResolver.INSTANCE,
JavaBeanValueResolver.INSTANCE,
FieldValueResolver.INSTANCE)
.build();
The text was updated successfully, but these errors were encountered: