Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stache issue with steal and single quotes #950

Closed
moschel opened this issue May 3, 2014 · 3 comments
Closed

stache issue with steal and single quotes #950

moschel opened this issue May 3, 2014 · 3 comments
Assignees
Milestone

Comments

@moschel
Copy link
Contributor

moschel commented May 3, 2014

Something is wrong with the escaping mechanism for stache with steal.

I added a breaking test (not really a test but a demo page that shows the bug) in the stache-steal branch. To see the issue, check out this branch and run can/view/stache/test/test_steal.html

The issue appears to be that any single quotes in the template get escaped wrong and show up as undefined.

If the template is:

'hi'

It renders:

undefinedhiundefined

The same works fine in Mustache and works fine if you run can.view.stache("'hi'")()

@moschel moschel added this to the 2.1.0 milestone May 3, 2014
@moschel
Copy link
Contributor Author

moschel commented May 3, 2014

related to 3e04450

@ccummings
Copy link
Contributor

Issue is this line in stache.js

In your example, the indexOf check returns 0 which is falsey. This line should be:

if("'\"\\".indexOf(character) !== -1) {

@justinbmeyer justinbmeyer self-assigned this May 3, 2014
@justinbmeyer
Copy link
Contributor

I will fix this while fixing IE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants