-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad formatting inside mixed JS/PHP script block #528
Comments
Thanks for fixing this! |
Actually it's not completely fixed, here is another test case which goes wrong: <html><body><script>
var test = {
<?= $condition ? 'item1' : 'item2' ?>: <?= $data ?>
};
</script></body></html> Output after formatting: <html>
<body>
<script>
var test = {
<
? php ? > : <?= $condition ? 'item1' : 'item2' ?>
};
</script>
</body>
</html> |
Thanks, I didn't spot any more formatting issues! |
@saurfang587 please post code, not screenshots. Before format:
After format:
|
@saurfang587 this is upstream - beautifier/js-beautify#1687 Place a comment before the first php tag as a workaround. |
Hi @bmewburn my code get changed after save Before Save After Save Can you please help me providing a solution? |
Try |
The following valid PHP code showcases a couple of issues I've seen with the formatter:
When formatting this code, it results in the following screwed up code:
The text was updated successfully, but these errors were encountered: