Going crazy with this. Can’t figure out if this is normal behavior.
I have added a filter to rewrite image inserts to use <figure>
and <figcaption>
. Works well.
However, when I insert an image in the Visual view and press return, I want it to start a new paragraph.
Instead it creates another <figure>
element and puts my next line of text in that.
Example of the code produced if switch to Text view:
<figure class="alignnone">
<a href="https://wordpress.stackexchange.com/questions/83997/path/to/image.jpg"><img class="alignnone size- wp-image-209" src="https://wordpress.stackexchange.com/questions/83997/path/to/image.jpg" width="199" height="43" /></a>
<figcaption>Image Caption</figcaption>
</figure>
<figure class="alignnone"`>This should be a new paragraph but is inside a figure tag.</figure>
Is there any way I can stop tinyMCE from replicating the previous block element? I know if you set some text as, say, an <h2>
and press return the next line defaults back to <p>
. That’s the behavior I want.