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

allow in-tag mustaches to precede multi-line start #336

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/pegjs/html/tag-html.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ start = tagHtml
This also needs to absorb comments for when using brackets
*/
tagHtml
= h:htmlStart __ '[' TERM* inTagMustaches:inTagMustache* fullAttributes:bracketedAttribute+ (_ inlineComment _ TERM)*
= h:htmlStart startingInTagMustaches:inTagMustache* __ '[' TERM* inTagMustaches:inTagMustache* fullAttributes:bracketedAttribute+ (_ inlineComment _ TERM)*
{
return parseInHtml(h, inTagMustaches, fullAttributes);
return parseInHtml(h, startingInTagMustaches.concat(inTagMustaches), fullAttributes);
}
/ h:htmlStart inTagMustaches:inTagMustache* fullAttributes:attribute*
{
Expand Down
10 changes: 10 additions & 0 deletions tests/integration/mustache/html-attributes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,14 @@ module('mustache: html attributes', function (hooks) {
test("with doublestache", function (assert) {
assert.compilesTo('p{{insertClass foo}} Hello', '<p {{insertClass foo}}>Hello</p>');
});

test("with multi-line", function (assert) {
const emblem = w(
"div{did-insert this.handler} [",
" class='test'",
"]",
);

assert.compilesTo(emblem, '<div {{did-insert this.handler}} class="test"></div>');
});
});