handlebars.java
handlebars.java copied to clipboard
is there a way not use escape in hbs, then keep undefined var?
@SneakyThrows
@Test
void testRenderUndefined() {
Handlebars handlebars = new Handlebars();
com.github.jknack.handlebars.Template template = handlebars.compileInline("Hi {{name}}, {{raw}}!");
Map<String, String> parameterMap = new HashMap<>();
parameterMap.put("name", "moto");
String templateString = template.apply(parameterMap);
assertEquals(templateString, "Hi moto, {{raw}}!");
}
I know using the following way can do this, but I don't want to change the template, because it is provided by other team