Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#26864 closed task (blessed) (fixed)

Consolidate handling of object, audio and video tags in wpautop

Reported by: azaozz's profile azaozz Owned by:
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:

Description

There is some code in both JS and PHP flavors of wpautop() that strips line breaks from inside <object> tags to prevent <br> and <p>. Something similar is needed for <audio> and <video>.

The general idea is to prevent <param>, <embed>, <track>, <source>, etc. from being wrapped in <p> without treating them as "block" elements.

Attachments (3)

26864.patch (3.3 KB) - added by azaozz 11 years ago.
Patch by wonderboymusic
26864.2.patch (11.9 KB) - added by azaozz 11 years ago.
26864.3.patch (13.7 KB) - added by azaozz 11 years ago.

Download all attachments as: .zip

Change History (14)

@azaozz
11 years ago

Patch by wonderboymusic

#1 @azaozz
11 years ago

Related: #26628. 26864.patch contains the wpautop() parts from 26628.5.diff.

@azaozz
11 years ago

#3 @azaozz
11 years ago

In 26864.2.patch:

  • Prevent <p> and <br> around <source> and <track> in wpautop.
  • Add a few unit tests.

@azaozz
11 years ago

#4 @azaozz
11 years ago

In 26864.3.patch:

  • Run the wpautop() regex only when <source> or <track> tags are present.
  • Test for running wpautop() from wp_richedit_pre().

#5 @azaozz
11 years ago

In 27094:

Consolidate handling of <object>, <audio> and <video> in wpautop() and add unit tests for them. Part props wonderboymusic, see #26864

#7 @wonderboymusic
11 years ago

In 27096:

The video shortcode unit test shouldn't be expected to maintain HTML comments.

See #26864.

#8 @SergeyBiryukov
11 years ago

  • Summary changed from Consolidate handling of object, autio and video tags in wpautop to Consolidate handling of object, audio and video tags in wpautop

#9 @helen
11 years ago

What else do we need here?

#10 @nacin
11 years ago

  • Type changed from enhancement to task (blessed)

#11 @nacin
11 years ago

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

Seems like this has been holding up nicely.

Note: See TracTickets for help on using tickets.