File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2194,7 +2194,7 @@ class Parser {
2194
2194
}
2195
2195
2196
2196
TemplateTokenVector tokenize () {
2197
- static std::regex comment_tok (R"( \{#([-~]?)(. *?)([-~]?)#\})" );
2197
+ static std::regex comment_tok (R"( \{#([-~]?)([\s\S\r\n] *?)([-~]?)#\})" );
2198
2198
static std::regex expr_open_regex (R"( \{\{([-~])?)" );
2199
2199
static std::regex block_open_regex (R"( ^\{%([-~])?[\s\n\r]*)" );
2200
2200
static std::regex block_keyword_tok (R"( (if|else|elif|endif|for|endfor|generation|endgeneration|set|endset|block|endblock|macro|endmacro|filter|endfilter|break|continue)\b)" );
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ TEST(SyntaxTest, SimpleCases) {
74
74
return testing::Throws<std::runtime_error>(Property (&std::runtime_error::what, testing::HasSubstr (expected_substr)));
75
75
};
76
76
77
+ EXPECT_EQ (
78
+ " ok" ,
79
+ render (" {# Hey\n Ho #}{#- Multiline...\n Comments! -#}{{ 'ok' }}{# yo #}" , {}, {}));
80
+
77
81
EXPECT_EQ (
78
82
" b" ,
79
83
render (R"( {% set _ = 1 %} {% set _ = 2 %}b)" , {}, lstrip_trim_blocks));
You can’t perform that action at this time.
0 commit comments