Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Skip doctype and comments in test dom tree
  • Loading branch information
sirreal committed Dec 19, 2023
commit b50e45dc1f7a4cf1ff9e1a80fd7a26e8012fa273
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