0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 01:11:24 +01:00

Allow whitespace after = in attributes (#3026)

This commit is contained in:
Mikhail Korepanov 2019-06-16 13:37:28 +03:00 committed by Conduitry
parent acdcaa41bf
commit ea74bfec55
3 changed files with 41 additions and 0 deletions

View File

@ -385,6 +385,7 @@ function read_attribute(parser: Parser, unique_names: Set<string>) {
let value: any[] | true = true;
if (parser.eat('=')) {
parser.allow_whitespace();
value = read_attribute_value(parser);
end = parser.index;
} else if (parser.match_regex(/["']/)) {

View File

@ -0,0 +1 @@
<button on:click= {foo}>Click</button>

View File

@ -0,0 +1,39 @@
{
"html": {
"start": 0,
"end": 38,
"type": "Fragment",
"children": [
{
"start": 0,
"end": 38,
"type": "Element",
"name": "button",
"attributes": [
{
"start": 8,
"end": 23,
"type": "EventHandler",
"name": "click",
"modifiers": [],
"expression": {
"type": "Identifier",
"start": 19,
"end": 22,
"name": "foo"
}
}
],
"children": [
{
"start": 24,
"end": 29,
"type": "Text",
"raw": "Click",
"data": "Click"
}
]
}
]
}
}