Changes:
+ * removed the newline after a comment (mimicks PHP behavior)
* added a syntax error exception when parent block is used on a template that does not extend another one
* made the Escaper and Optimizer extensions enabled by default
* fixed sandbox extension when used with auto output escaping
if (!preg_match('/(.*?)'.preg_quote($this->options['tag_comment'][1], '/').'/As', $this->code, $match, null, $this->cursor)) {
throw new Twig_Error_Syntax('unclosed comment', $this->lineno, $this->filename);
}
+
$this->moveCursor($match[0]);
$this->moveLineNo($match[0]);
+
+ // mimicks the behavior of PHP by removing the newline that follows instructions if present
+ if ("\n" === substr($this->code, $this->cursor, 1)) {
+ $this->moveCursor("\n");
+ $this->moveLineNo("\n");
+ }
+
break;
case $this->options['tag_block'][0]: