Closed nbordeau closed 4 years ago
@nbordeau What is your setting for editor.insertSpaces
?
That is what it goes off to format.
Oh and I was going crazy about the formatting and I finally figured out what was causing it to get all messed up.
type=image/png>
Missing the quotes on the type attribute here tricks it into thinking its closing one of the tags
type="image/png">
I know you technically aren't required to use quotes here because its only if it contains " ' ` = < > but it will fix your issue.
Closing this unless someone wants me to keep it open then go ahead and comment.
I work on multiple PHP projects with different rulesets (PSR2, WordPress-Extra, etc...) and the default "Detect Indentation" in VS Code normally is not able to detect it properly. Therefore sometimes when I have the WordPress-Extra ruleset in my
.phpcs.xml
file, Format HTML in PHP starts indenting everything with spaces even though they are supposed to be tabs.Before Example:
After Format HTML in PHP:
I would expect the HTML formatting to abide by similar rules as the PHP formatting. If spaces are used via PHP, then spaces should be used in HTML. If tabs, then tab in both.