Any way to convert single line of HTML into multiline?

Is there any quick key command to convert code like this:

<div><p>Hello.</p></div>

to this:

<div>
  <p>
    Hello.
  </p>
</div>



1

Ctrl+Alt+L.But you need to remove 'p' from 'Don't break if inline content' list in Settings/Editor/Code Style/HTML, Other. And probably play with other formatting options

1

Sorry, what command is ctrl+alt+L? I'm on Mac and I also have customized my keymap.

0

Code | Reformat Code

Formattings rules can be configured at "Settings (Preferences on Mac) | Editor | Code Style | HTML"

0

Thanks. After changing code formatting rules, the best I could get was:

<div>
  <p>Text here.</p>
</div>

I couldn't get it to put the text on a separate line from the P tag.

1
Avatar
Permanently deleted user

Thanks! 

Anybody knows how to do it the other way around? (multiline to single line)

2

请先登录再写评论。