diff --git a/src/TinyHtmlMinifier.php b/src/TinyHtmlMinifier.php
index d628c06..8c914c7 100644
--- a/src/TinyHtmlMinifier.php
+++ b/src/TinyHtmlMinifier.php
@@ -82,10 +82,10 @@ public function minify(string $html) : string
return $this->output;
}
- // Walk trough html
+ // Walk through html
private function walk(&$part)
{
- $tag_parts = explode('>', $part);
+ $tag_parts = explode('>', $part, 2); // Limit of 2 parts to prevent issues with '>' in content (eg. JS comparison)
$tag_content = $tag_parts[0];
if (!empty($tag_content)) {
diff --git a/tests/tests.html b/tests/tests.html
index 212464e..0e2354e 100644
--- a/tests/tests.html
+++ b/tests/tests.html
@@ -66,6 +66,10 @@