diff --git a/compiler/parse/state/tag.js b/compiler/parse/state/tag.js index 6724773514..1613fd4552 100644 --- a/compiler/parse/state/tag.js +++ b/compiler/parse/state/tag.js @@ -62,6 +62,7 @@ export default function tag ( parser ) { let attribute; while ( attribute = readAttribute( parser ) ) { attributes.push( attribute ); + parser.allowWhitespace(); } parser.allowWhitespace(); diff --git a/test/parser/attribute-multiple/input.svelte b/test/parser/attribute-multiple/input.svelte new file mode 100644 index 0000000000..a5adf38f2c --- /dev/null +++ b/test/parser/attribute-multiple/input.svelte @@ -0,0 +1 @@ +
diff --git a/test/parser/attribute-multiple/output.json b/test/parser/attribute-multiple/output.json new file mode 100644 index 0000000000..30112ec629 --- /dev/null +++ b/test/parser/attribute-multiple/output.json @@ -0,0 +1,48 @@ +{ + "html": { + "start": 0, + "end": 28, + "type": "Fragment", + "children": [ + { + "start": 0, + "end": 28, + "type": "Element", + "name": "div", + "attributes": [ + { + "start": 5, + "end": 11, + "type": "Attribute", + "name": "id", + "value": [ + { + "start": 9, + "end": 10, + "type": "Text", + "data": "x" + } + ] + }, + { + "start": 12, + "end": 21, + "type": "Attribute", + "name": "class", + "value": [ + { + "start": 19, + "end": 20, + "type": "Text", + "data": "y" + } + ] + } + ], + "children": [] + } + ] + }, + "css": null, + "js": null +}