Open
Description
Using the {{!var}} something {{/!var}} notation didn't work when the var was set to TRUE
This is because in the code it only checks the meta "!" when the val is false. If the val is true, the meta is still set to "!" making it truthy and then the script doesn't know what to do with it, so returns nothing.
So, I added this (the "else if" at the bottom)
if (!val) {
// handle if not
if (meta == '!') {
return render(inner, vars);
}
// check for else
if (has_else) {
return render(if_false, vars);
}
return "";
}
else if (meta == '!')
return "";
If there's a better way, or if I'm doing something wrong, please let me know.
There may be other instances where it returns nothing. Maybe ensuring all code paths return would be a good way to lock things down.
Great engine otherwise! Use it every day. Thanks for creating it.
Metadata
Metadata
Assignees
Labels
No labels