bcosca/fatfree — pull request #640 by sorbits (2014-07-08 11:17:05+00:00)
Title: Fix missing newlines after template expansion

Before this commit the following code:

$template = "{{ @foo }}\nbar\n";
var_dump(Preview::instance()->resolve($template, array('foo' => 'bar')));

Would output:

string(7) "barbar\n"

This is because the template expander will replace “{{ … }}” with “” and when such tags are followed by a newline, the PHP preprocessor omits it.

Since the template engine is mentioned as useful for generating emails, the newline stripping behavior is undesired and should not be inherited from PHP.