[wp-trac] [WordPress Trac] #31695: Enclosing oEmbed using `embed_oembed_html` is generating invalid HTML

WordPress Trac noreply at wordpress.org
Thu Oct 15 18:35:15 UTC 2015


#31695: Enclosing oEmbed using `embed_oembed_html` is generating invalid HTML
-------------------------------------------------+-------------------------
 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 rodrigosprimo):

 The same problem happens when you add a Facebook video to a post. An
 unclosed `<p>` is added before the `<script>` tag. The following code:

 {{{
 <div id="fb-root"></div><script>(function(d, s, id) {  var js, fjs =
 d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js =
 d.createElement(s); js.id = id;  js.src =
 "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.3";
 fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-
 jssdk'));</script><div class="fb-video" data-allowfullscreen="1" data-
 href="/CatracaLivre/videos/vl.344619742400665/907235222646823/?type=3"><div
 class="fb-xfbml-parse-ignore"></div></div>
 }}}

 Becomes (note the added unclosed `<p>` before `<script>` on the second
 line):

 {{{
 <div id="fb-root"></div>
 <p><script>(function(d, s, id) {  var js, fjs =
 d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js =
 d.createElement(s); js.id = id;  js.src =
 "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.3";
 fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-
 jssdk'));</script>
 <div class="fb-video" data-allowfullscreen="1" data-
 href="/CatracaLivre/videos/vl.344619742400665/907235222646823/?type=3">
 <div class="fb-xfbml-parse-ignore"></div>
 }}}

 Contrary to the case @vaurdan reported, this is happening on a clean
 WordPress install with no plugins enabled running the latest version from
 master.

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


More information about the wp-trac mailing list