0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

Merge pull request #1446 from sveltejs/gh-1445

allow spaces around reserved words used in tags in attributes
This commit is contained in:
Rich Harris 2018-05-10 22:03:01 -04:00 committed by GitHub
commit 57c0fdc6b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

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

View File

@ -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();
}

View File

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