I'm wanting to remove the p tags that wrap img tags by default in ckeditor.
I don't want to totally disable p tags or change the EnterMode to another tag. I only want to stop images being wrapping in paragraphs.
I want this done client side, not server side.
I have:
<p>Some text in a parapgraph.</p>
<p><img src="picture.jpg"></p>
<p>Another paragraph</p>
I want:
<p>Some text in a parapgraph.</p>
<img src="picture.jpg">
<p>Another paragraph</p>
Quick fix:
This will work if there is nothing else on the line except the three tags.
Updated:
Here is a PHP function. You can call it from JavaScript.
Reference