[wp-trac] [WordPress Trac] #31695: Extra unclosed <p> tag before <script> breaking the_content()

WordPress Trac noreply at wordpress.org
Wed Jul 22 13:26:40 UTC 2015


#31695: Extra unclosed <p> tag before <script> breaking the_content()
-------------------------------------------------+-------------------------
 Reporter:  vaurdan                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Formatting                           |  Review
 Severity:  normal                               |     Version:
 Keywords:  needs-unit-tests wpautop needs-      |  Resolution:
  patch                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by vaurdan):

 After some testing, we're able to discover what was making the closing
 </p> to disappear. We've found that if the user has Jetpack, and the theme
 had support for `jetpack-responsive-videos`, like twentyfourteen have, the
 closing `</p>` tag would disappear from the Twitter oEmbed HTML, making it
 invalid (as reported above).

 This is happening here:
 https://github.com/Automattic/jetpack/blob/a5d57deb765944f207edc6c1c2482a43ede21101/modules
 /theme-tools/responsive-videos.php#L43

 We can isolate only the "bad" code, and we will have this filter:

 {{{
 function break_embed( $html ) {
     return '<div> ' . $html . '</div>';
 }
 add_filter( 'embed_oembed_html', 'break_embed' );
 }}}

 If you test with that filter, you will see that the `</p>` tag will
 disappear, making the HTML invalid.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31695#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list