Skip to content

Commit 44e5276

Browse files
committed
Fixed Regex for IE ex: '.main .nested[max-width~="1080px"]' that is detected as '.main [max-width~="1080px"].nested'
1 parent 3ea4b37 commit 44e5276

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ElementQueries.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
}
198198
}
199199

200-
var regex = /,?([^,\n]*?)\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]([^\n\s\{]*?)/mgi;
200+
var regex = /,?([^,\n]*?)\[[\s\t]*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]([^\n\s\{]*)/mgi;
201201
var ieReg = /,?([^,\n]*?)\[*?(min|max)-(width|height)[\s\t]*?[~$\^]?=[\s\t]*?"([^"]*?)"[\s\t]*?]([^\n\s\{]*?)([.|\#]\w*[^,\n\t\s])/mgi;
202202

203203
/**
@@ -209,7 +209,7 @@
209209
css = css.replace(/'/g, '"');
210210
while (null !== (match = regex.exec(css))) {
211211
if (5 < match.length) {
212-
smatch = match[1] || match[5] || smatch;
212+
smatch = match[1] + match[5];
213213
queueQuery(smatch, match[2], match[3], match[4]);
214214
}
215215
}

0 commit comments

Comments
 (0)