[wp-trac] [WordPress Trac] #31375: Image caption with heading adds an empty paragraph at page edits

WordPress Trac noreply at wordpress.org
Thu Feb 19 11:22:19 UTC 2015

#31375: Image caption with heading adds an empty paragraph at page edits
 Reporter:  sweman        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |

 I'm experiencing a problem when trying to use heading tags within image
 captions. Upon inserting (or editing) the image on a page, I wrote a
 heading before a block of text in the caption. The whole thing would look
 something like this:

 <h3>Heading here</h3>A block of text directly following the heading.

 What happens is that every time I edit the page in any way (not even
 touching the image or image caption) there is an extra empty paragraph
 added to the caption text. That means that anything below the caption
 jumps one line further down at every edit.

 Just to see if this is some plugin conflict, I created a clean WordPress
 install without plugins, and tried the same thing. The problem was
 reproduced. Looking at the html code generated, there is a new <p></p>
 added at every page edit, and sometimes a couple of <br /> are inserted
 before the heading tags. Here is a link to my test site:


 I tried it using both themes twenty fourteen and twenty fifteen,
 experiencing the same bug.

Ticket URL: <https://core.trac.wordpress.org/ticket/31375>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list