From ec8692fb9eb3b5f2cca0ba71ffad7062b4833554 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 3 Sep 2017 19:02:07 +0200 Subject: [PATCH] Fix InlineHTML indentation --- lib/PhpParser/PrettyPrinter/Standard.php | 2 +- test/code/prettyPrinter/nestedInlineHTML.test | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/code/prettyPrinter/nestedInlineHTML.test diff --git a/lib/PhpParser/PrettyPrinter/Standard.php b/lib/PhpParser/PrettyPrinter/Standard.php index 200394e..6a11ceb 100644 --- a/lib/PhpParser/PrettyPrinter/Standard.php +++ b/lib/PhpParser/PrettyPrinter/Standard.php @@ -832,7 +832,7 @@ class Standard extends PrettyPrinterAbstract } protected function pStmt_InlineHTML(Stmt\InlineHTML $node) { - $newline = $node->getAttribute('hasLeadingNewline', true) ? $this->nl : ''; + $newline = $node->getAttribute('hasLeadingNewline', true) ? "\n" : ''; return '?>' . $newline . $node->value . ' +Test + +Test +