stache issue with steal and single quotes #950

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

Comments

Projects
None yet
3 participants
@moschel
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

This comment has been minimized.

Show comment
Hide comment
@moschel

moschel May 3, 2014

Contributor

related to 3e04450

Contributor

moschel commented May 3, 2014

related to 3e04450

@ccummings

This comment has been minimized.

Show comment
Hide comment
@ccummings

ccummings May 3, 2014

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) {
Contributor

ccummings commented May 3, 2014

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

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer May 3, 2014

Contributor

I will fix this while fixing IE.

Contributor

justinbmeyer commented May 3, 2014

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