Skip to content

Commit c23cda9

Browse files
committed
Fix HTML input processing
1 parent 8a063e1 commit c23cda9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ public static function parse_html5_dat_testfile( $filename ) {
170170
}
171171

172172
if ( $yield_test ) {
173-
yield array( $test_line_number, $test_context_element, $test_html, $test_dom );
173+
yield array(
174+
$test_line_number,
175+
$test_context_element,
176+
// Remove the trailing newline
177+
substr( $test_html, 0, -1 ),
178+
$test_dom
179+
);
174180
}
175181
}
176182

@@ -238,6 +244,12 @@ public static function parse_html5_dat_testfile( $filename ) {
238244
fclose( $handle );
239245

240246
// Return the last result when reaching the end of the file.
241-
return array( $line_number, $test_context_element, $test_html, $test_dom );
247+
return array(
248+
$test_line_number,
249+
$test_context_element,
250+
// Remove the trailing newline
251+
substr( $test_html, 0, -1 ),
252+
$test_dom
253+
);
242254
}
243255
}

0 commit comments

Comments
 (0)