From bb23f6e6a51bdb0f555c6ec94703cffdfa9a7531 Mon Sep 17 00:00:00 2001 From: pantor Date: Tue, 21 Nov 2017 22:46:09 +0100 Subject: [PATCH] fix else if parser --- src/inja.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inja.hpp b/src/inja.hpp index 16a1029..8303117 100644 --- a/src/inja.hpp +++ b/src/inja.hpp @@ -633,7 +633,7 @@ public: case Parsed::Statement::Condition: { auto condition_container = std::make_shared(); - const Regex regex_condition{"(if|else if|else) ?(.*)"}; + const Regex regex_condition{"(if|else if|else(?! if)) ?(.*)"}; Match condition_match = match_delimiter; MatchClosed else_if_match = search_closed_on_level(input, match_delimiter.regex(), regex_condition_open, regex_condition_close, regex_condition_else_if, condition_match); while (else_if_match.found()) {