use string match to simplify regexp

pull/6435/head
Ignatius Bagus 5 years ago
parent 57ea279c56
commit 611a5150d2
No known key found for this signature in database
GPG Key ID: 357C6674A45CC06B

@ -147,7 +147,8 @@ export default class Selector {
for (const block of this.blocks) {
for (const selector of block.selectors) {
if (selector.type === 'PseudoClassSelector' && selector.name === 'global') {
if (/[^\\],/.test(selector.children[0].value)) {
const match = selector.children[0].value.match(/\(.*?\)|([^\\],)/);
if (match && match[1]) {
component.error(selector, {
code: 'css-invalid-global-selector',
message: ':global(...) must contain a single selector'

Loading…
Cancel
Save