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

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

scorphus
Copy link
Contributor

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/

 * Correctly render HTML comment inside tag with element callback (EJS) or helper (Mustache)
 * Fix and test cases
@daffl
Copy link
Contributor

daffl commented Mar 14, 2013

👍 - Looks good. Awesome job!

@scorphus
Copy link
Contributor Author

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants