Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Improve the regex expression for matching quotation marks in the elementAttributesAreValid test #230

Open
jessebeach opened this issue May 4, 2014 · 0 comments
Labels

Comments

@jessebeach
Copy link
Member

The following regex expression in the elementAttributesAreValid test does not accurately capture missing or mismatched quotation marks.

//Element has mis-matched quotes
var quotes = element.raw.match(/\'|\"/g);
if (quotes && quotes.length % 2 !== 0) {
    test.add(Case({
        element: node,
        expected: (typeof node === 'object') && (node.nodeType === 1) && $(node).closest('.quail-test').data('expected') || null,
        status: 'failed'
    }));
    failed = true;
}

An even number of mismatched quotations will pass this test.

@jessebeach jessebeach added the bug label May 4, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant