deface icon indicating copy to clipboard operation
deface copied to clipboard

Rewrap contents

Open gsmetal opened this issue 6 years ago • 2 comments

Is there any way to rewrap contents? I. e. I have original

<p class="some-class">
  <!-- contents -->
</p>

How can I achieve this with deface?

<div class="some-another-class">
  <!-- contents -->
</div>

gsmetal avatar Mar 19 '19 13:03 gsmetal

@gsmetal see https://github.com/spree/deface#action, I think you can use surround or surround_contents for that use case.

tenshiAMD avatar Oct 31 '19 09:10 tenshiAMD

@tenshiAMD No, with surround the result will be

<div class="some-another-class">
<p class="some-class">
  <!-- contents -->
</p>
</div>

And with surround_contents it will be

<p class="some-class">
<div class="some-another-class">
  <!-- contents -->
</div>
</p>

But I need to replace original wrapper with another one with same contents.

gsmetal avatar Oct 31 '19 10:10 gsmetal