Skip to content

Commit

Permalink
fix: fix serialize spread attribute (#414)
Browse files Browse the repository at this point in the history
* fix: fix serialize spread attribute

* Create tame-eyes-provide.md
  • Loading branch information
ota-meshi authored and natemoo-re committed Jul 20, 2022
1 parent 88c4cb8 commit 7ec26c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-eyes-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/compiler": patch
---

Fix serialize spread attribute
2 changes: 1 addition & 1 deletion packages/compiler/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function serializeAttributes(node: TagLikeNode): string {
break;
}
case 'spread': {
output += `{...${attr.value}}`;
output += `{...${attr.name}}`;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/test/parse/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let content = "Testing 123";
<div>Hello {value}</div>
<h1 name="value" set:html={content} empty {shorthand} expression={true} literal=\`tags\`>Hello {value}</h1>
<h1 name="value" set:html={content} empty {shorthand} expression={true} literal=\`tags\` {...spread}>Hello {value}</h1>
<Fragment set:html={content} />
Expand Down

0 comments on commit 7ec26c2

Please sign in to comment.