summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HTMLParser.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php
index 84d174e..8c864cb 100644
--- a/src/HTMLParser.php
+++ b/src/HTMLParser.php
@@ -585,7 +585,8 @@ class HTMLParser
$match = false;
for ($i = 1; $i <= 2; $i++) {
foreach ($this->dom->getElementsByTagName('h' . $i) as $hTag) {
- if ($hTag->nodeValue === $curTitle) {
+ // Trim texts to avoid having false negatives when the title is surrounded by spaces or tabs
+ if (trim($hTag->nodeValue) === trim($curTitle)) {
$match = true;
}
}