plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

Invalid output caused by "inline" node before "leadingComments" node

Open ShlomyTuby opened this issue 6 years ago • 1 comments

@prettier/plugin-php v0.11.2 Playground link

Input: with space before the PHP starting tag

 <?php // comment
echo the_content(); ?>

Output:

 <?php // comment
// comment
?>echo the_content(); ?>

The extra PHP closing tag break the PHP code itself

Note: In case I remove the space before the PHP starting tag, the output is correct:

Input:

<?php // comment
echo the_content(); ?>

Output:

<?php // comment
echo the_content(); ?>

ShlomyTuby avatar Jul 18 '19 07:07 ShlomyTuby

Yes, bug

alexander-akait avatar Jul 18 '19 10:07 alexander-akait