From ddd4a33f3b719de59ba4902e5b6f1696eb79bb34 Mon Sep 17 00:00:00 2001 From: Lyphon Date: Mon, 3 Jun 2019 22:59:30 +0300 Subject: [PATCH 1/2] Fix 2929 --- src/compiler/compile/css/Selector.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts index 713b035efe..56f97ca852 100644 --- a/src/compiler/compile/css/Selector.ts +++ b/src/compiler/compile/css/Selector.ts @@ -239,7 +239,8 @@ function attribute_matches(node: Node, name: string, expected_value: string, ope function class_matches(node, name: string) { return node.classes.some(function(class_directive) { - return class_directive.name === name; + name = new RegExp(`\\b${name}\\b`); + return name.test(class_directive.name); }); } From bef6f153dba30439215ffe80cc1db4b3baefda47 Mon Sep 17 00:00:00 2001 From: Lyphon Date: Mon, 3 Jun 2019 23:29:21 +0300 Subject: [PATCH 2/2] Fix build appveyor build failure --- src/compiler/compile/css/Selector.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/compile/css/Selector.ts b/src/compiler/compile/css/Selector.ts index 56f97ca852..854acde216 100644 --- a/src/compiler/compile/css/Selector.ts +++ b/src/compiler/compile/css/Selector.ts @@ -239,8 +239,7 @@ function attribute_matches(node: Node, name: string, expected_value: string, ope function class_matches(node, name: string) { return node.classes.some(function(class_directive) { - name = new RegExp(`\\b${name}\\b`); - return name.test(class_directive.name); + return new RegExp(`\\b${name}\\b`).test(class_directive.name); }); }