Previously, the compiler could handle most situations with newlines but
had issues in certain situations with closing parentheses being followed
by a newline. This case is relevant when code of multiple template listeners
is inserted at the end of an if condition as the template engine concatenates
template listener code by newlines.
*/
protected function compileIfTag($tagArgs, $elseif = false) {
$tagArgs = $this->replaceQuotes($tagArgs);
- $tagArgs = str_replace(' ', '', $tagArgs);
+ $tagArgs = str_replace(array(' ', "\n"), '', $tagArgs);
// split tags
preg_match_all('~('.$this->conditionOperatorPattern.')~', $tagArgs, $matches);