I want to remove elements that wrap <img> tags but keep it inside <article> element:
So from this:
<article>
<p>...
<br>
<br>
<strong>...
<span>
<div>
<img ....
</div>
</span>
<p>...
Make this:
<article>
<p>...
<br>
<br>
<strong>...
<img ....
<p>...
Without knowing how many and what tags is the <img> nested.
I was thinking about finding the first ancestor before <article>, remove it and append the copy of <img> tag.
The problem is that append adds it at the bottom of the article.
Do you know how to do that?