Repository navigation
Commit aa6c1b4
Fix test broken by assertEqualHTML whitespace fix (WP 7.0 / #64531)
WordPress core ticket #64531 (fixed in 6.9.1, included in 7.0) corrected
build_visual_html_tree() to stop trimming leading whitespace from text nodes.
Whitespace-only text nodes between elements are now preserved and compared.
The test_card_block_renders_with_background_color test had a multi-line
$expected string that started with a newline before <div> and had newlines
and tabs between </div...> and <p>. These became text nodes in the parsed
tree that don't exist in the actual render output, causing the assertion
to fail on WP 7.0.
Fix: remove the leading newline before <div> and close the gap between
the opening tag and <p> so no whitespace text nodes are introduced.
Attributes can still span multiple lines for readability — whitespace
inside a tag is not a text node.
Also bump .wp-env.json to wordpress-7.0-beta1 to reflect the WP version
this fix targets.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent df1e62d commit aa6c1b4
2 files changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
0 commit comments