Structural replace : remove HTML tags but keep content


I would like to remove some tags in my document but keep content.

Is there a way to do it with the structural search and replace?

For instance, I want to replace:
<section id="test"><p>bla bla/p> text</section>

<p>bla bla/p> text

I have found examples to work with attributes and the tag name itself but I can't find a way to work with the tag content.

Fabio Chelly


please try

<section $id$="$value$">$text$</section>

as search template and


as replace one... Minimum count for $id$ is 0, $value$ - 1, $text$ - 1

Not the best solution may be, but it works for me


You can do it with "ctrl-shift-d" shortcut or via "alt-enter".
But this idiots in jetbrain missed an option to remove all tags, only one per shortcut key press allowed.


Please sign in to leave a comment.