Search code examples
htmlvisual-studio-codeformatting

Line break disappears when pasting in VS Code


Example of my problem:

введите сюда описание изображения

Next, I copy the selected area (the tag with the line break in front of it):

введите сюда описание изображения

Next, I paste the copied text into the cursor position:

введите сюда описание изображения

введите сюда описание изображения

As you can see, vs code formatting has removed the line break before the tag.
All extensions for xml and html except default html support from vs code are disabled.
How do I change the formatting so that the line break before the tag is saved?


Solution

  • I've solved the problem by installing the new formatter: Beautify.

    After installing the extension, you need to set it as a formatter for HTML:

    enter image description here