diff --git a/__tests__/fixtures/formatted.raw_php_block.blade.php b/__tests__/fixtures/formatted.raw_php_block.blade.php index 0bce3dc4..265025cd 100644 --- a/__tests__/fixtures/formatted.raw_php_block.blade.php +++ b/__tests__/fixtures/formatted.raw_php_block.blade.php @@ -4,7 +4,7 @@ @foreach ($users as $user) @php $users = $_GET; - + foreach ($users as $key1 => $value) { if (is_array($value)) { foreach ($value as $key2 => $value2) { diff --git a/src/formatter.ts b/src/formatter.ts index d2974ddd..d1d81828 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -1357,6 +1357,10 @@ export default class Formatter { return prefixForEnd + line; } + if (line.length === 0) { + return line; + } + return prefix + line; }) .join('\n')