vscode-better-align icon indicating copy to clipboard operation
vscode-better-align copied to clipboard

Version 1.4.1 messes up html formatting in PHP

Open murugappanrm opened this issue 2 years ago • 4 comments

In my index.php in the body section: This is the code entered:

<body>
        <form action="">
            <input type="text" name="" />
        </form>
 </body>

After saving the file, the formatting is messed up as:

<body>
        <form action  =  "">
         <input type  =  "text" name  =   "" />
        </form>
</body>

This happens when I enable "Align After Type Enter" .

murugappanrm avatar Feb 23 '23 03:02 murugappanrm

This is expected behavior, I think you can use shortcuts(alt+A) instead.

chouzz avatar Feb 24 '23 02:02 chouzz

Its ok. I fixed it. This extension was dependent on another extension for PHP. I corrected the setting in PHP and it works fine now. Except that the auto alignment does not work. I tested on 2 machines. I have to resort to key shortcuts. However it works fine in HTML scripts.

murugappanrm avatar Feb 24 '23 22:02 murugappanrm

Not sure what the use case is for aligning on these elements...

jonnylink avatar Apr 07 '23 23:04 jonnylink

There was no use case. It was settings in the Extension which caused the misalignment. I removed the setting and it works fine. I am not sure why this setting exists in the first place. The only problem is that that auto align does not work.

lexman1958 avatar Apr 08 '23 04:04 lexman1958