Skip to content

Commit

Permalink
Fix crash for table (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored May 3, 2022
1 parent e8e49a1 commit 21168b1
Show file tree
Hide file tree
Showing 4 changed files with 10,902 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/parser/astro-parser/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ function fixLocations(node: ParentNode, code: string): void {
node.type === "component" ||
node.type === "custom-element"
) {
if (!node.position!.end) {
return
}
const closeTagStart = tokenIndexSafe(
code,
`</${node.name}`,
Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures/parser/ast/table-with-each01-input.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
const items = ['Foo', 'Bar'];
---
<table>
<tbody>
{items.map((item) => (
<tr>
<td>{item}</td>
</tr>
))}
</tbody>
</table>
Loading

0 comments on commit 21168b1

Please sign in to comment.