Skip to content

Commit 0122955

Browse files
committed
allow spaces around reserved words used in tags in attributes (#1445)
1 parent 5dd149e commit 0122955

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/parse/state/tag.ts

+1
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ function readSequence(parser: Parser, done: () => boolean) {
439439
chunks.push(currentChunk);
440440
}
441441

442+
parser.allowWhitespace();
442443
const expression = readExpression(parser);
443444
parser.allowWhitespace();
444445
parser.eat('}', true);

test/runtime/samples/attribute-dynamic-reserved/_config.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ export default {
33
class: 'foo'
44
},
55

6-
html: `<div class="foo"></div>123`,
6+
html: `
7+
<div class="foo"></div>123
8+
<div class="foo"></div>123
9+
`,
710

811
test ( assert, component, target ) {
912
component.set({ class: 'bar' });
10-
assert.equal( target.innerHTML, `<div class="bar"></div>123` );
13+
assert.htmlEqual( target.innerHTML, `
14+
<div class="bar"></div>123
15+
<div class="bar"></div>123
16+
` );
1117

1218
component.destroy();
1319
}
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
<div class='{class}'></div>{123}
2+
<div class='{ class }'></div>{ 123 }

0 commit comments

Comments
 (0)