diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php
index eeec5d4ea..cb1c5b1d1 100644
--- a/program/lib/Roundcube/rcube_washtml.php
+++ b/program/lib/Roundcube/rcube_washtml.php
@@ -598,7 +598,7 @@ class rcube_washtml
if (!$this->is_xml && class_exists('Masterminds\HTML5')
// HTML5 parser is slow with content that contains a lot of tags
// disable it for such cases (https://github.com/Masterminds/html5-php/issues/181)
- && substr_count($html, '<') > 10000
+ && substr_count($html, '<') < 10000
) {
try {
$html5 = new Masterminds\HTML5();