chjj / zest

An absurdly fast CSS selector engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Matching fails on element with multiple classes where extra class is a prefix of the target class

taylorhughes opened this issue · comments

<div class="foo-bar foo">

zest('.foo') will not match the above element because the code examines the first matching class ("foo-bar") and sees that it doesn't match, and the comparison stops there. The fix is to examine all the matches, not just the first match, in ~= here:

https://github.com/chjj/zest/blob/master/lib/zest.js#L471

Fixed in domino (which includes zest) in fgnass/domino@614565c