mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-02 00:55:23 +00:00
Merge branch '1.x' into 2.x
* 1.x: Don't clear PHP buffer when an error occurs with debug=true Remove duplicate phpdoc
This commit is contained in:
@@ -33,7 +33,13 @@ class SpacelessNode extends Node implements NodeOutputInterface
|
||||
{
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write("ob_start(function () { return ''; });\n")
|
||||
;
|
||||
if ($compiler->getEnvironment()->isDebug()) {
|
||||
$compiler->write("ob_start();\n");
|
||||
} else {
|
||||
$compiler->write("ob_start(function () { return ''; });\n");
|
||||
}
|
||||
$compiler
|
||||
->subcompile($this->getNode('body'))
|
||||
->write("echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));\n")
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user