Skip to content

Commit

Permalink
Fix HTML patterns from PR review
Browse files Browse the repository at this point in the history
Co-authored by: @adamziel
  • Loading branch information
dmsnell committed Jul 26, 2022
1 parent 67662d0 commit a6b7d67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/experimental/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public function find_next_tag() {
* lead us to skip over other tags and lose track of our place. So we need to search for
* _every_ tag and then check after we find one if it's the one we are looking for.
*/
"~<!--(?>.*?-->)|<!\[CDATA\[(?>.*?>)|<\?(?>.*?)>|<(?P<TAG>[a-z][^\t\x{0A}\x{0C} /?>]*)~Smui",
"~<!--(?>.*?-->)|<!\[CDATA\[(?>.*?\]\]>)|<\?(?>.*?)>|<(?P<TAG>[a-z][^\t\x{0A}\x{0C} /?>]*)~Smui",
$this->document,
$tag_match,
PREG_OFFSET_CAPTURE,
Expand Down Expand Up @@ -606,7 +606,7 @@ public function find_next_tag() {
public function find_next_attribute() {
// Find the attribute name
if ( 1 !== preg_match(
'~[\t\x{0a}\x{0c}\x{0d} ]*(?P<NAME>=?[^=/>\t\x{0C} ]*)~Smiu',
'~[\t\x{0a}\x{0c} ]*(?P<NAME>=?[^=/>\t\x{0A}\x{0C} ]*)~Smiu',
$this->document,
$attribute_match,
PREG_OFFSET_CAPTURE,
Expand Down Expand Up @@ -643,7 +643,7 @@ public function find_next_attribute() {
break;

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

Expand Down

0 comments on commit a6b7d67

Please sign in to comment.