From d43ce28f16392077cb191c462491b9a5af48f79f Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Tue, 19 Dec 2023 15:20:47 +0100 Subject: [PATCH] Better tag finding --- tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php b/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php index 2eb898e476913..7c5eca8aa154f 100644 --- a/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php +++ b/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php @@ -185,8 +185,10 @@ public static function parse_html5_dat_testfile( $filename ) { if ( '|' === $line[0] ) { $candidate = substr( $line, 2 ); $trimmed = trim( $candidate ); - // We ignore `) + // Tag must start with ascii alphabetic + if ( strlen( $trimmed > 2 ) && '<' === $trimmed[0] && ctype_alpha( $trimmed[1] ) ) { $test_dom .= $candidate; } }