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

Comments duplicating out of scope

Open joemaller opened this issue 4 years ago • 1 comments

@prettier/plugin-php v0.16.2 Playground link

Input:

<?php if (true): ?>

html text

<?php else: ?>
  
<?php
/**
 * comment
 */
?>
  
<?php endif 


Output:

<?php if (true): ?>

html text

<?php
    /**
     * comment
     */
    /**
 * comment
 */
    ?>else: ?>
  
<?php
    /**
 * comment
 */
    ?>
  
<?php endif;

Also happening with single-line comments:

@prettier/plugin-php v0.16.2 Playground link

Input:

<?php if (true): ?>

html text

<?php else: ?>
  
<?php
// comment
?>
  
<?php endif 


Output:

<?php if (true): ?>

html text

<?php
    // comment
    // comment
    ?>else: ?>
  
<?php
    // comment
    ?>
  
<?php endif;

joemaller avatar Apr 17 '21 17:04 joemaller

See also: https://github.com/prettier/plugin-php/issues/1228

joemaller avatar Apr 17 '21 17:04 joemaller