Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove surrounding tags in IntelliJ IDEA

In IDEA I can select a block of html and press ctrl+alt+t to surround that with a tag. I am trying to find the option/keymapping to do the opposite... I want to select a block of html and remove the outermost surrounding tag. Here's an example:

<div id="one">
  <div id="two">Hello</div>
</div>

If I select the #one div in the editor I should be able to have it removed, leaving only this:

<div id="two">Hello</div>

Any way to have IDEA do this for me?

like image 777
user605331 Avatar asked Jan 16 '12 14:01

user605331


People also ask

How do I remove a closing tag?

For HTML tags, you can press Alt+Enter and select Remove tag instead of removing an opening tag and then a closing tag.

How to remove tags HTML?

The HTML tags can be removed from a given string by using replaceAll() method of String class. We can remove the HTML tags from a given string by using a regular expression. After removing the HTML tags from a string, it will return a string as normal text.


1 Answers

Code | Unwrap/Remove... Ctrl+Shift+Delete

(Cmd+Shift+fn+Backspace on Mac)

enter image description here

like image 135
Peter Gromov Avatar answered Sep 20 '22 05:09

Peter Gromov