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

Mustache and EJS issues with attributes and truthy blocks #504

Merged
merged 2 commits into from Oct 21, 2013

Conversation

Projects
None yet
2 participants
@ccummings
Contributor

ccummings commented Oct 16, 2013

Found 3 cases where Mustache and EJS fail to render correct output. All of these have the full attribute inside of a truthy section (if block in EJS).

Case 1: Attribute value has hyphen
<p {{#attribute}}data-test="{{attribute}}"{{/attribute}}></p>
Entire value of attribute is escaped resulting in:

<p data-test="&quot;test-value&quot;"></p>

Case 2: Attribute value has spaces
<p {{#attribute}}data-test="{{attribute}}"{{/attribute}}></p>
Entire value of attribute is escaped resulting in:

<p data-test="&quot;test" value&#34;=""></p>

Case 3: Outputting list of attributes in a loop
<p {{#attribute}}{{name}}="{{value}}"{{/attribute}}></p>
entire string of attributes is escaped and results in a mangled mess:

<p data-test1="&quot;value1&quot;data-test2=&quot;value2&quot;data-test3=&quot;value3&quot;"></p>

justinbmeyer added a commit that referenced this pull request Oct 21, 2013

Merge pull request #504 from bitovi/attribute-issues
Mustache and EJS issues with attributes and truthy blocks

@justinbmeyer justinbmeyer merged commit d0e6f0f into master Oct 21, 2013

1 check passed

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