Skip to content

Commit 38f63b5

Browse files
committed
Fix regex for dots and hashes
Previously, a string such as ‘#some-id.some-class’ will match as ‘some-id.some-class’, rather than just ‘some-class’ - This adjustment will match only the last substring following either a hash or a dot, and containing neither.
1 parent 7ebfc6a commit 38f63b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ClassServer implements vsc.CompletionItemProvider {
4444

4545
private regex = [
4646
/(class|id|className)=["|']([^"^']*$)/i,
47-
/(\.|\#)[^\s]*$/i,
47+
/(?:\.([^\s\#\.]*)$)|(?:\#([^\s\.\#]*)$)/i,
4848
/<style[\s\S]*>([\s\S]*)<\/style>/ig
4949
];
5050

0 commit comments

Comments
 (0)