Home > Software engineering >  Multiline class name to single line in PhpStorm/VSCode/Sublime
Multiline class name to single line in PhpStorm/VSCode/Sublime

Time:04-07

Not sure if this relevant question or not

Here is an example HTML block

                <div
                  
                >
               </div>

Is there any easy way that I can change all those class names to a single line?

Expected output:

<div >
</div>

CodePudding user response:

In PhpStorm or any other JetBrains IDE:

  1. Select the lines
  2. Invoke "Code | Join Lines" (Ctrl Shift J here on a Windows keymap)

Final result:

            <div ></div>

Notes:

  • first line indent will remain
  • may have an extra space in some places (in this case before the first class name: <div class=" ltr:ml-auto)
  • Related