| 35 | } |
| 36 | |
| 37 | static removePseudoElements(value: string): string { |
| 38 | const splits = value.split(/\\/g); |
| 39 | const splittedEscapes = splits.map((split, i) => { |
| 40 | if (splits.length - 1 > i) { |
| 41 | // returns the normal split |
| 42 | // as pseudo elements are just at the end |
| 43 | return split; |
| 44 | } |
| 45 | |
| 46 | // remove the first char |
| 47 | // in case it is a : |
| 48 | const firstChar = split.charAt(0) || ''; |
| 49 | const modifiedString = split.slice(1); |
| 50 | // replace everything with a : |
| 51 | // this should be a pseudo element |
| 52 | const removedPseudoElements = modifiedString.replace(/:.+/g, ''); |
| 53 | |
| 54 | return firstChar + removedPseudoElements; |
| 55 | }); |
| 56 | |
| 57 | return splittedEscapes.join(''); |
| 58 | } |
| 59 | |
| 60 | static replaceAnAttributeSelector( |
| 61 | result: string | false, |