-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Description
For the below invalid syntax with triple brackets:
"Hey {{{data.variables.aa | default('there') }}"
data = { variables: {} }
I get output as [object][object]
instead of getting syntax error. Why twig didn't throw it as an invalid syntax?
FYI: for input with starting & closing 3 braces : "Hey {{{data.variables.aa | default('there') }}}"
I get output: "Hey [object][object]}"
Since I mistakenly added 3 braces, I expect to get an error instead of [object][object]
I used template.tokens to catch any twig syntax errors, but that didn't catch above error:
try {
const template: any = Twig.twig({ data: startingString });
if (template) {
return template.tokens;
}
} catch (err) {
this.logger.error('Invalid twig syntax', startingString, err);
}
Any thoughts?
Metadata
Metadata
Assignees
Labels
No labels