nytimes / backbone.stickit

Backbone data binding, model binding plugin. The real logic-less templates.
MIT License
1.64k stars 176 forks source link

Escape quotes in value for radio matcher #309

Closed jeremywadsack closed 8 years ago

jeremywadsack commented 8 years ago

Under jQuery 1.12, the provided expression for matching a radio button when the value contains a quote throws a "Syntax error, unrecognized expression".

This resolves that by properly escaping quote characters in the value before building the matching expression.

Note that in order to prove this and build a failing test I fixed up test/index.html to pull in qunit from the vendor folder (it was missing). This is because the phantomjs runner is broken right now in the npm/karma tests. (There's some discussion of this under #307.)

Then I found that this doesn't fail in the bundled jQuery (1.8.3), but does fail with 1.12.x that we are using. I updated the reference in test/index.html to use the version from the jQuery CDN just to make the test show that the code is fixed. I don't know if you want to update the vendored jQuery to the latest from the 1.x branch, but I'm happy to make that change as well.

jeremywadsack commented 8 years ago

@akre54 Fixes done. Rebased, squashed, and pushed.

Let me know if there are any other changes that I should look at.

Thanks for the quick response on this!