@theodorejb Just tried your fork to see if the fix also handles nested custom helper if-else if statements.
I found this bug in LigthNCandy: zordius/lightncandy#313
I have a custom helper: IfEquals (actually using the demo code for a helper from your repo), but when if I do a custom helper chained else blocks that is nested to many other helpers (if's and a custom contains) I get a fatal error:
Fatal error: Uncaught Exception: Unexpect token {{/ifEquals}} ! Previous token {{#[if]}} is not closed
If I replace the {{else ifEquals expression}} with {{else}}{{ifEquals expression}} I do not get an error