Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#29219 closed defect (bug) (fixed)

A figure tag gets an injected ghost p tag

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

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 12 years ago.

Download all attachments as: .zip

Change History (6)

#1 @wonderboymusic
12 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review4.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.


12 years ago

#3 @azaozz
12 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
12 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 31186:

Ensure that <figcaption> is not autop'd.

Fixes #29219.

#5 @wonderboymusic
12 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.