Make WordPress Core


Ignore:
Timestamp:
01/23/2026 06:04:10 PM (8 months ago)
Author:
jonsurrell
Message:

Build/Test Tools: Ensure assertEqualHTML() recognizes whitespace text.

Ensure whitespace text nodes are correctly represented by build_visual_html_tree().

The build_visual_html_tree() function used by assertEqualHTML() would remove some leading whitespace from text nodes. Some whitespace-only text nodes were omitted from the tree.

Developed in https://github.com/WordPress/wordpress-develop/pull/10765.

Follow-up to [60295].

Props jonsurrell, dmsnell, bernhard-reiter.
Fixes #64531.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/wpGetArchives.php

    r61326 r61519  
    222222
    223223                $expected = join(
    224                         "\n",
     224                        '',
    225225                        array_map(
    226226                                static function ( $id ) {
    227                                         return sprintf( '<li><a href="%s">%s</a></li>', get_permalink( $id ), get_the_title( $id ) );
     227                                        return sprintf( "\t<li><a href='%s'>%s</a></li>\n", get_permalink( $id ), get_the_title( $id ) );
    228228                                },
    229229                                $ids
Note: See TracChangeset for help on using the changeset viewer.