From e4b4292580426600bdb7a5257441a7a70228da23 Mon Sep 17 00:00:00 2001 From: Abdelrhman Said Date: Sat, 30 Mar 2024 05:55:49 +0200 Subject: [PATCH] match css attribute selectors --- src/Languages/Css/Patterns/CssSelectorPattern.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Languages/Css/Patterns/CssSelectorPattern.php b/src/Languages/Css/Patterns/CssSelectorPattern.php index df05306..75d8b6c 100644 --- a/src/Languages/Css/Patterns/CssSelectorPattern.php +++ b/src/Languages/Css/Patterns/CssSelectorPattern.php @@ -13,13 +13,15 @@ input: 'code, .asd, #id, .hl-blur, @font-face, kbd, samp, -pre { +pre, +[data-foo="bar"] { font-family: ui-monospace, monospace; }', output: 'code, .asd, #id, .hl-blur, @font-face, kbd, samp, -pre ', +pre, +[data-foo="bar"] ' )] final readonly class CssSelectorPattern implements Pattern { @@ -27,7 +29,7 @@ public function getPattern(): string { - return '(?[\@\-\#\.\w\s,\n]+)\{'; + return '(?[\@\-\#\.\w\s,\n\[\]+=\'"]+)\{'; } public function getTokenType(): TokenTypeEnum