public function checkComparison(array $rule, AbstractNode $node): bool
    {
        if ($rule['key'] == 'plaintext') {
            // plaintext search
            $nodeValue = $node->text();
        } else {
            // normal search
            $nodeValue = $node->getAttribute($rule['key']);
        }

        $check = $this->match($rule['operator'], $rule['value'], $nodeValue);

        // handle multiple classes
        if ( ! $check && $rule['key'] == 'class') {
            $nodeClasses = explode(' ', $node->getAttribute('class'));
            foreach ($nodeClasses as $class) {
                if ( ! empty($class)) {
                    $check = $this->match($rule['operator'], $rule['value'], $class);
                }
                if ($check) {
                    break;
                }
            }
        }

        return $check;
    }