Skip to content

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

@taylorhughes

Description

@taylorhughes

<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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions