summaryrefslogtreecommitdiff
path: root/lib/fuckhtml.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fuckhtml.php')
-rw-r--r--lib/fuckhtml.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php
index f3a6efe..8b5eba5 100644
--- a/lib/fuckhtml.php
+++ b/lib/fuckhtml.php
@@ -240,7 +240,17 @@ class fuckhtml{
public function getElementsByFuzzyAttributeValue(string $name, string $value, $collection = null){
$elems = $this->getElementsByAttributeName($name, $collection);
- $value = explode(" ", $value);
+ $value =
+ explode(
+ " ",
+ trim(
+ preg_replace(
+ '/ +/',
+ " ",
+ $value
+ )
+ )
+ );
$return = [];