plugin-php
plugin-php copied to clipboard
Bug with mixture of php with comments and html
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
I ran into the same issue yesturday.
<?php
if ($add_call || $edit_call){
?>
<?php
} elseif ($add_call || $edit_call) {
// ADD EDIT CALL NOTE form
?>
<h1> Call Header </h1>
<?php
}
?>
That snippit will format to this:
<?php
if ($add_call || $edit_call) { ?>
<?php } elseif ($add_call || $edit_call) {<?php
// ADD EDIT CALL NOTE form
?>
<h1> Call Header </h1>
<?php } ?>
From README:
Formatting of files that contain mixed PHP and HTML is still considered unstable