We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d1496a commit 3d8b586Copy full SHA for 3d8b586
src/helper.js
@@ -216,14 +216,16 @@ export const matchWithSelector = (element, selector) => {
216
return attrValue.raw === unquoted;
217
}
218
219
- // TODO: Fix as it will match hyphen as well
220
case "~=": {
221
- return new RegExp(`\\b${unquoted}\\b`).test(attrValue.raw)
+ return new RegExp(`(?<=\\s)${unquoted}`).test(
+ attrValue.raw
222
+ ) || unquoted === attrValue.raw
223
224
225
case "|=": {
226
+ return new RegExp(`(?<=-)${unquoted}`).test(
227
228
229
230
231
case "^=": {
0 commit comments