Skip to content

Bug with mixture of php with comments and html #2419

@dmitryostrov

Description

@dmitryostrov

Prettier 3.5.3

PHP Plugin 0.22.4

# Options (if any):

Input:

<?php
const a = true;
?><div></div>
<?php if (2==2) {
  // comment
  ?><span></span><?php
  return true;
}

Output:

<?php
const a = true; ?><div></div>
<?php if (2 == 2) {<?php
    // comment
    ?><span></span><?php return true;}

Expected behavior:
< ? php above the comment line at the end is not needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions