Skip to content

Commit a6b7d67

Browse files
committed
Fix HTML patterns from PR review
Co-authored by: @adamziel
1 parent 67662d0 commit a6b7d67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/experimental/class-wp-html-processor.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ public function find_next_tag() {
577577
* lead us to skip over other tags and lose track of our place. So we need to search for
578578
* _every_ tag and then check after we find one if it's the one we are looking for.
579579
*/
580-
"~<!--(?>.*?-->)|<!\[CDATA\[(?>.*?>)|<\?(?>.*?)>|<(?P<TAG>[a-z][^\t\x{0A}\x{0C} /?>]*)~Smui",
580+
"~<!--(?>.*?-->)|<!\[CDATA\[(?>.*?\]\]>)|<\?(?>.*?)>|<(?P<TAG>[a-z][^\t\x{0A}\x{0C} /?>]*)~Smui",
581581
$this->document,
582582
$tag_match,
583583
PREG_OFFSET_CAPTURE,
@@ -606,7 +606,7 @@ public function find_next_tag() {
606606
public function find_next_attribute() {
607607
// Find the attribute name
608608
if ( 1 !== preg_match(
609-
'~[\t\x{0a}\x{0c}\x{0d} ]*(?P<NAME>=?[^=/>\t\x{0C} ]*)~Smiu',
609+
'~[\t\x{0a}\x{0c} ]*(?P<NAME>=?[^=/>\t\x{0A}\x{0C} ]*)~Smiu',
610610
$this->document,
611611
$attribute_match,
612612
PREG_OFFSET_CAPTURE,
@@ -643,7 +643,7 @@ public function find_next_attribute() {
643643
break;
644644

645645
default:
646-
$pattern = '~(?P<VALUE>[^\t\x{0a}\x{0c}\x{0d} >]*)~Smiu';
646+
$pattern = '~(?P<VALUE>[^\t\x{0a}\x{0c} >]*)~Smiu';
647647
break;
648648
}
649649

0 commit comments

Comments
 (0)