[wp-trac] [WordPress Trac] #33834: wpautop treats html comments as content

WordPress Trac noreply at wordpress.org
Fri Sep 11 16:44:59 UTC 2015


#33834: wpautop treats html comments as content
--------------------------+-----------------------------
 Reporter:  opajaap       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This php code:

 {{{
 $str = '<div>My div1</div><!-- comment --><div>My div2</div>';
 echo $str.'<br/>'.wpautop($str);
 }}}

 Produces this output as seen in the page source:
 {{{
 <div>My div1</div><!-- comment --><div>My div2</div><br/><div>My
 div1</div>
 <p><!-- comment -->
 <div>My div2</div>
 }}}

 I.e. unbalanced
 {{{
 <p>
 }}}
 and wrong layout.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33834>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list