diff --git a/src/index.js b/src/index.js index 9270ab0..ef5f3b9 100644 --- a/src/index.js +++ b/src/index.js @@ -297,7 +297,7 @@ export default class Critters { rule.selectors = rule.selectors.filter(sel => { // Strip pseudo-elements and pseudo-classes, since we only care that their associated elements exist. // This means any selector for a pseudo-element or having a pseudo-class will be inlined if the rest of the selector matches. - sel = sel.replace(/::?[a-z-]+\s*{/gi, '{').trim(); + sel = sel.replace(/::?[a-z-]+\s*(\{|$)/gi, '$1').trim(); try { return document.querySelector(sel) != null; } catch (e) {