WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#29219 closed defect (bug) (fixed)

A figure tag gets an injected ghost p tag

Reported by: grayghostvisuals Owned by: wonderboymusic
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.9.2
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:
PR Number:

Description

It seems in the WordPress 3.9.2 release anything wrapped in a figure tag gets a ghost p and br tag injected. Seems a similar ticket was closed, but I'm not seeing a status on the release of this fix.

Author Input

<figure>
<pre><code>code sample</code></pre>
<figcaption>a small note about the figure above</figcaption>
</figure>

WordPress Output:

<figure>
<pre><code>code sample</code></pre>
<p></p>
<figcaption>a small note about the figure above</figcaption>
</figure>
<br>

Attachments (1)

29219.diff (1.7 KB) - added by wonderboymusic 5 years ago.

Download all attachments as: .zip

Change History (6)

@wonderboymusic
5 years ago

#1 @wonderboymusic
5 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.2

Thanks for the report, grayghostvisuals - I'll have someone confirm 29219.diff as the proper fix.

This ticket was mentioned in Slack in #core by wonderboymusic. View the logs.


5 years ago

#3 @azaozz
5 years ago

29219.diff looks good. <figcaption> is pretty similar to <li>. It's not a "typical" block tag, can only be inside <figure> and can contain "flow content".

#4 @wonderboymusic
5 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 31186:

Ensure that <figcaption> is not autop'd.

Fixes #29219.

#5 @wonderboymusic
5 years ago

In 31191:

After [31186], remove figcaption from the list of inline elements that are autop'd in Tests_Formatting_Autop::test_that_wpautop_treats_inline_elements_as_inline().

See #29219.

Note: See TracTickets for help on using tickets.