Is there a way to disable access to control flow (if, else, unless, with, etc.)?
For my use case, I need a templating engine that provides efficient keyword replacement ({{ keyword }}) but I don't want users to be able to use control flow statements.
Essentially, if the control flow is disabled, then when evaluating the template the engine would ignore the control flow statements.
const userTemplate = '<h1>Title {{ title }}</h1>{{#if condition}} show {{/if}}';
const template = Handlebars.compile(userTemplate);
const context = { title: 'My App', condition: true};
const result = template(context); // currently: '<h1>Title My App</h1>show'
const result = template(context); // expected with control flow disable: '<h1>Title My App</h1>{{#if condition}} show {{/if}}' // gets ignored.
Hi
Is there a way to disable access to control flow (if, else, unless, with, etc.)?
For my use case, I need a templating engine that provides efficient keyword replacement ({{ keyword }}) but I don't want users to be able to use control flow statements.
Essentially, if the control flow is disabled, then when evaluating the template the engine would ignore the control flow statements.
I couldn't find this on the docs.
Thanks Joao