Skip to content

Commit 6a0e28e

Browse files
committed
refactor parsing to handle escaped characters
1 parent 4dca4ff commit 6a0e28e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-html-css",
33
"displayName": "HTML CSS Support",
44
"description": "CSS Intellisense for HTML",
5-
"version": "2.0.10",
5+
"version": "2.0.11",
66
"license": "MIT",
77
"publisher": "ecmel",
88
"author": {

src/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface Style {
2020

2121
export function parse(text: string) {
2222
const selector =
23-
/([.#])(-?[_a-zA-Z]+[_a-zA-Z0-9-]*)(?=[#.,()\s\[\]\^:*"'>=_a-zA-Z0-9-]*{[^}]*})/g;
23+
/([.#])(-?[_a-zA-Z]+[\\!+_a-zA-Z0-9-]*)(?=[#.,()\s\[\]\^:*"'>=_a-zA-Z0-9-]*{[^}]*})/g;
2424
const styles: Style[] = [];
2525
const lc = lineColumn(text, { origin: 0 });
2626
let match,
@@ -40,7 +40,7 @@ export function parse(text: string) {
4040
line,
4141
col,
4242
type: match[1] as StyleType,
43-
selector: match[2],
43+
selector: match[2].replaceAll("\\", ''),
4444
});
4545
}
4646
return styles;

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2021",
44
"module": "ES2020",
55
"moduleResolution": "Bundler",
66
"isolatedModules": true,

0 commit comments

Comments
 (0)