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>



5 comments
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

Code | Reformat Code

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

0
Comment actions Permalink

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
Comment actions Permalink

Thanks! 

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

1

Please sign in to leave a comment.