HTML is adding line breaks before inline elements.

After the most recent update, PHPStorm has undone my default settings.

I'm trying to prevent it from adding line breaks within HTML text.

  • I've set Wrap attributes to Do not wrap
  • I've unchecked Wrap text
  • I've set Remove new line before: to br,a,strong,span,cite,em,i,b

Still, when I hit Ctrl + Alt + L to reformat my code, it will add line breaks before inline elements. E.g.

<p>Here's some <strong>important text</strong>, and a bit more.</p>

becomes

<p>Here's some
    <strong>important text</strong>, and a bit more.
</p>

I wouldn't want it to change at all. How can I fix it?

0
3 comments
Hello, 
Unfortunately, I was not able to reproduce this behavior based on your description. Could you please clarify if you are using any other formatting tools, for example, Prettier? If so, can you reproduce the issue if Prettier is disabled? If it is still reproduced or if you don't have any third-party tools, please share your code style preferences (`<IDE config dir>/codestyles/<scheme name>.xml` if you are using an IDE-level scheme, or `.idea\codeStyles\Project.xml` when using a project scheme). Thank you in advance.
0

I have the same issue. PHPStorm just ignores all HTML formatting settings and does it's own thing. I had to disable format on save completely so it stopped breaking all the html. Prettier is also disabled. 

0

Hello,

Please share more precise instructions on how to reproduce this issue. In particular, share your formatting settings as I described above, and the problematic .HTML file. I will research this case and follow up with you. 

0

Please sign in to leave a comment.