Can somebody explain this weird formatting logic?
Now, given, it's been a while since I've done straight-up HTML+PHP front-end coding... but I can't make sense of what PHPStorm is doing here:

So, I typed `<p>`, which then nicely also generated the `</p>` end tag right after it, then typed `<?php` (for some reason it didn't auto-generate the `php` like it does outside of HTML), then the `foreach` statement and closed it (with `?>`), then hit Enter (Windows), and put the caret at the beginning of a new empty line and then put the `</p>` end tag on its own line with a bunch of indents in front of it...
I can't make sense of the logic here, but these kinds of things happening create a bunch of junk code that's hard to read and follow nesting.
Can somebody explain this?! There's nothing unusual going on before or after the `p` tag... it's at the top-level nesting level (meaning, not nested in any other tag); the code's very simple right now.
Please sign in to leave a comment.
I was not able to reproduce it on PhpStorm 2020.3.2. In my case, "Enter" moves <p> to the beginning of the next line as it should with no blank lines or indents at all.
What version do you have installed? Did you change anything in Code Style settings (mine are pretty much default at the moment)