Skip to content

Commit 39dc0ca

Browse files
authored
Merge pull request #143 from maxiaozhi/patch-1
Fix the matching exception
2 parents 5953daa + ef0a2ef commit 39dc0ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Dom/Query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function range($selector)
125125
*/
126126
public function removeHead()
127127
{
128-
$html = preg_replace('/<head.+?>.+<\/head>/is', '<head></head>', $this->html);
128+
$html = preg_replace('/(<head>|<head\s+.+?>).+<\/head>/is', '<head></head>', $this->html);
129129
$this->setHtml($html);
130130
return $this->ql;
131131
}

0 commit comments

Comments
 (0)