Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier

CssInliner::replaceUnmatchableNotComponent │ private │ WC 1.0

Helps removeUnmatchablePseudoComponents() replace or remove a selector :not(...) component if its argument contains pseudo-elements or dynamic pseudo-classes.

Метод класса: CssInliner{}

Хуков нет.

Возвращает

string. the full match if there were no unmatchable pseudo components within; otherwise, any preceding combinator followed by "*", or an empty string if there was no preceding combinator

Использование

// private - только в коде основоного (родительского) класса
$result = $this->replaceUnmatchableNotComponent( $matches ): string;
$matches(array<array-key, string>) (обязательный)
array of elements matched by the regular expression.

Код CssInliner::replaceUnmatchableNotComponent() WC 11.3.0

private function replaceUnmatchableNotComponent(array $matches): string
{
    [$notComponentWithAnyPrecedingCombinator, $anyPrecedingCombinator, $notArgumentInBrackets] = $matches;

    if ($this->hasUnsupportedPseudoClass($notArgumentInBrackets)) {
        return $anyPrecedingCombinator !== '' ? $anyPrecedingCombinator . '*' : '';
    }
    return $notComponentWithAnyPrecedingCombinator;
}