Skip to content

Commit 21168b1

Browse files
authored
Fix crash for table (#10)
1 parent e8e49a1 commit 21168b1

File tree

4 files changed

+10902
-3
lines changed

4 files changed

+10902
-3
lines changed

src/parser/astro-parser/parse.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ function fixLocations(node: ParentNode, code: string): void {
114114
node.type === "component" ||
115115
node.type === "custom-element"
116116
) {
117-
if (!node.position!.end) {
118-
return
119-
}
120117
const closeTagStart = tokenIndexSafe(
121118
code,
122119
`</${node.name}`,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
const items = ['Foo', 'Bar'];
3+
---
4+
<table>
5+
<tbody>
6+
{items.map((item) => (
7+
<tr>
8+
<td>{item}</td>
9+
</tr>
10+
))}
11+
</tbody>
12+
</table>

0 commit comments

Comments
 (0)