Make WordPress Core

Opened 3 years ago

Closed 3 weeks ago

#33834 closed defect (bug) (wontfix)

wpautop treats html comments as content

Reported by: 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 (4)

#1 @swissspidy
3 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
3 years ago

This problem still exists on version 4.4-alpha-34061

#3 @lkraav
3 years ago

This is still a problem in 4.4.2.

#4 @iseulde
3 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

Note: See TracTickets for help on using tickets.