From 0122955a16405fd75d44d6f12ee09f9fb845165c Mon Sep 17 00:00:00 2001 From: Conduitry Date: Thu, 10 May 2018 20:05:57 -0400 Subject: [PATCH] allow spaces around reserved words used in tags in attributes (#1445) --- src/parse/state/tag.ts | 1 + .../samples/attribute-dynamic-reserved/_config.js | 10 ++++++++-- .../samples/attribute-dynamic-reserved/main.html | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index 074f790b65..4a0d050144 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -439,6 +439,7 @@ function readSequence(parser: Parser, done: () => boolean) { chunks.push(currentChunk); } + parser.allowWhitespace(); const expression = readExpression(parser); parser.allowWhitespace(); parser.eat('}', true); diff --git a/test/runtime/samples/attribute-dynamic-reserved/_config.js b/test/runtime/samples/attribute-dynamic-reserved/_config.js index e0e349b7bc..cd597ad004 100644 --- a/test/runtime/samples/attribute-dynamic-reserved/_config.js +++ b/test/runtime/samples/attribute-dynamic-reserved/_config.js @@ -3,11 +3,17 @@ export default { class: 'foo' }, - html: `
123`, + html: ` +
123 +
123 + `, test ( assert, component, target ) { component.set({ class: 'bar' }); - assert.equal( target.innerHTML, `
123` ); + assert.htmlEqual( target.innerHTML, ` +
123 +
123 + ` ); component.destroy(); } diff --git a/test/runtime/samples/attribute-dynamic-reserved/main.html b/test/runtime/samples/attribute-dynamic-reserved/main.html index f0318b96de..3909ae60b6 100644 --- a/test/runtime/samples/attribute-dynamic-reserved/main.html +++ b/test/runtime/samples/attribute-dynamic-reserved/main.html @@ -1 +1,2 @@
{123} +
{ 123 }