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

HTML comments with either an element callback (EJS) or a helper (Mustache) rendered incorrectly #313

Merged
merged 1 commit into from Mar 15, 2013

Conversation

Projects
None yet
2 participants
@scorphus
Contributor

scorphus commented Mar 14, 2013

In a Mustache template, for example, if you have:

<li {{data "item"}}>
    <!-- this is comment #1 -->
    {{title}}
    <!-- this is comment #2 -->
</li>

this gets incorrectly rendered:

<li  data-view-id='9'>
    <!-- this is comment #1 - data-view-id='10'/>
    One
    <!-- this is comment #2 -->
</li>

This bug is demonstrated, for both EJS and Mustache, in this fiddle: http://jsfiddle.net/scorphus/vmLvA/

The fix stops the effect of an element callback (in EJS templates) or a helper (in Mustache templates) and is demonstrated in this fiddle: http://jsfiddle.net/scorphus/vmLvA/1/

Stop element callback or helper effect on '>'
 * Correctly render HTML comment inside tag with element callback (EJS) or helper (Mustache)
 * Fix and test cases
@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Mar 14, 2013

Contributor

👍 - Looks good. Awesome job!

Contributor

daffl commented Mar 14, 2013

👍 - Looks good. Awesome job!

@scorphus

This comment has been minimized.

Show comment
Hide comment
@scorphus

scorphus Mar 15, 2013

Contributor

Thanks, @daffl! It's being pretty amazing understanding things and fixing these bugs =)

Contributor

scorphus commented Mar 15, 2013

Thanks, @daffl! It's being pretty amazing understanding things and fixing these bugs =)

daffl added a commit that referenced this pull request Mar 15, 2013

Merge pull request #313 from scorphus/master
HTML comments with either an element callback (EJS) or a helper (Mustache) rendered incorrectly

@daffl daffl merged commit 4a7eeda into canjs:master Mar 15, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment