Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Multiple shorthand echoes in a row break when formatted #2022

Open
alexb148 opened this issue Jun 29, 2022 · 0 comments · May be fixed by #2088
Open

Multiple shorthand echoes in a row break when formatted #2022

alexb148 opened this issue Jun 29, 2022 · 0 comments · May be fixed by #2088

Comments

@alexb148
Copy link

Prettier 2.4.0

PHP Plugin 0.18.4

Input:

<?= $var1 ?><?= $var2 ?>

Output:

<?=
$var1
$var2
?>

Expected behavior:

The above output does not work, it is fundamentally broken code.

There should be no change:

<?= $var1 ?><?= $var2 ?>

...or the variables should be concatenated:

<?= $var1 . $var2 ?>

Note that if there is a space in the middle, this works fine and is not changed:

<?= $var1 ?> <?= $var2 ?>
cseufert added a commit that referenced this issue Oct 17, 2022
Currently breaks outputing an inline comment

closes #2022
@cseufert cseufert linked a pull request Oct 17, 2022 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants