handlebars.java
handlebars.java copied to clipboard
Is the word "this" a reserved key name for Template compileInline?
For this code
Map<String, Object> model = Map.of("name", "Ron", "that", "is cool");
Template template = handlebars.compileInline("{{name}} {{that}}!");
System.out.println(template.apply(model));
I get the output
"Ron is cool!"
But if I change the name of the second item from "that" to "this"..
Map<String, Object> model = Map.of("name", "Ron", "this", "is cool");
Template template = handlebars.compileInline("{{name}} {{this}}!");
The map object is printed out instead
Ron {this=is cool, name=Ron}!
is "this" is the intended behavior? Thanks
Edit: and if it is, is there a way to escape names like "this"? Triple braces didn't seem to work