Skip to content

Commit

Permalink
Skip doctype and comments in test dom tree
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 19, 2023
1 parent 434c84f commit 4f1bf7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public static function parse_html5_dat_testfile( $filename ) {
if ( '|' === $line[0] ) {
$candidate = substr( $line, 2 );
$trimmed = trim( $candidate );
if ( '<' === $trimmed[0] && '<!DOCTYPE' !== substr( $trimmed, 0, 9 ) ) {
// We ignore `<!` starters to skip `<!--` (comment opener) and `<!DOCTYPE`.
if ( '<' === $trimmed[0] && '<!' !== substr( $trimmed, 0, 2 ) ) {
$test_dom .= $candidate;
}
}
Expand Down

0 comments on commit 4f1bf7d

Please sign in to comment.