match css attribute name only selectors (no value)

pull/906/head
Johnny Hauser 7 years ago
parent f8ac12c57b
commit 8edfd643f1

@ -224,6 +224,7 @@ function attributeMatches(node: Node, name: string, expectedValue: string, opera
if (!attr) return false; if (!attr) return false;
if (attr.value === true) return operator === null; if (attr.value === true) return operator === null;
if (attr.value.length > 1) return true; if (attr.value.length > 1) return true;
if (!expectedValue) return true;
const pattern = operators[operator](expectedValue, caseInsensitive ? 'i' : ''); const pattern = operators[operator](expectedValue, caseInsensitive ? 'i' : '');
const value = attr.value[0]; const value = attr.value[0];

Loading…
Cancel
Save