add missing code

lets say you have the following code

<ul>
Item 1
item 2
Item 3
Item 4

</ul>

I was wondering if phpStorm has the ability so that when i select that block and hit a command it will reformat the code so the result would be this

<ul>
<li>Item 1</li>
<li>item 2</li>
<li>Item 3</li>
<li>Item 4</li>

</ul>

1 comment
Comment actions Permalink

No and Yes.

No -- there is no magic button/action that will fix this for you with just a single click.

But Yes -- there are some tools that can greatly simplify such process. In your particular example -- Zen Coding is the answer:
1) Select all 4 lines
2) Code | Surround With ...
3) Choose "XML Zen Coding"
4) Enter li* and press Enter
5) Check result

Links:

0

Please sign in to leave a comment.