Merge pull request #1446 from sveltejs/gh-1445

allow spaces around reserved words used in tags in attributes
pull/1448/head
Rich Harris 6 years ago committed by GitHub
commit 57c0fdc6b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -439,6 +439,7 @@ function readSequence(parser: Parser, done: () => boolean) {
chunks.push(currentChunk);
}
parser.allowWhitespace();
const expression = readExpression(parser);
parser.allowWhitespace();
parser.eat('}', true);

@ -3,11 +3,17 @@ export default {
class: 'foo'
},
html: `<div class="foo"></div>123`,
html: `
<div class="foo"></div>123
<div class="foo"></div>123
`,
test ( assert, component, target ) {
component.set({ class: 'bar' });
assert.equal( target.innerHTML, `<div class="bar"></div>123` );
assert.htmlEqual( target.innerHTML, `
<div class="bar"></div>123
<div class="bar"></div>123
` );
component.destroy();
}

@ -1 +1,2 @@
<div class='{class}'></div>{123}
<div class='{ class }'></div>{ 123 }

Loading…
Cancel
Save