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 “<?php … ?>” 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.
Loading
Please sign in to comment