Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#33834 new defect (bug)

wpautop treats html comments as content

Reported by: opajaap's profile opajaap Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: General Keywords:
Focuses: Cc:


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


and wrong layout.

Change History (3)

#1 @swissspidy
9 years ago

There were some changes in #33645 regarding wpautop and HTML comments.

Can you confirm this still breaks when running trunk / a nightly build?

#2 @opajaap
9 years ago

This problem still exists on version 4.4-alpha-34061

#3 @lkraav
8 years ago

This is still a problem in 4.4.2.

Note: See TracTickets for help on using tickets.