[wp-trac] [WordPress Trac] #64531: assertEqualHTML may ignore leading whitespace text

WordPress Trac noreply at wordpress.org
Tue Jan 20 20:41:42 UTC 2026


#64531: assertEqualHTML may ignore leading whitespace text
--------------------------------------+---------------------
 Reporter:  jonsurrell                |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:
Component:  Build/Test Tools          |     Version:  6.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by dmsnell):

 > The expected trees are:

 @jonsurrell I think there might be a mistake in this declaration, as I
 would consider the two inputs identical.

 {{{#!php
 <?php
 $this->assertEqualHTML(
   "<p> x</p>",
   "<p>\nx</p>"
 );
 }}}

 Should produce the following tree in both cases.

 {{{
 <p>
   " x"
 }}}

 This is because of whitespace normalization. If we wanted the newline we’d
 need a character reference instead of the actual newline character.

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


More information about the wp-trac mailing list