Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#29219 closed defect (bug) (fixed)

A figure tag gets an injected ghost p tag

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


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

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

WordPress Output:

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

Attachments (1)

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

Download all attachments as: .zip

Change History (6)

9 years ago

#1 @wonderboymusic
9 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.

9 years ago

#3 @azaozz
9 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
9 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
9 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.