diff --git a/.changeset/stupid-rats-cough.md b/.changeset/stupid-rats-cough.md
new file mode 100644
index 000000000..e72dde879
--- /dev/null
+++ b/.changeset/stupid-rats-cough.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/compiler': patch
+---
+
+Revert table related parsing change as it resulted in a regression
diff --git a/internal/parser.go b/internal/parser.go
index 1236b5671..6f6b3da0b 100644
--- a/internal/parser.go
+++ b/internal/parser.go
@@ -2176,10 +2176,9 @@ func inRowIM(p *parser) bool {
func inCellIM(p *parser) bool {
switch p.tok.Type {
case StartExpressionToken:
- p.exitLiteralIM = getExitLiteralFunc(p)
p.addExpression()
p.afe = append(p.afe, &scopeMarker)
- p.originalIM = inCellIM
+ p.originalIM = inBodyIM
p.im = inExpressionIM
return true
case EndExpressionToken:
diff --git a/internal/printer/printer_test.go b/internal/printer/printer_test.go
index d56d0328e..dd3bfce20 100644
--- a/internal/printer/printer_test.go
+++ b/internal/printer/printer_test.go
@@ -1959,6 +1959,50 @@ const value = 'test';
code: `${bool && $$render` + BACKTICK + `${$$maybeRenderHead($$result)}` + BACKTICK + `} ${!bool && $$render` + BACKTICK + ` ` + BACKTICK + `}`,
},
},
+ {
+ name: "table simple case",
+ source: `---
+const content = "lol";
+---
+
+
+
+
+
+ {content}
+
+ {
+ (
+
+ 1
+
+ )
+ }
+
Hello
+
+
+`,
+ want: want{
+ frontmatter: []string{"", `const content = "lol";`},
+ // TODO: This output is INCORRECT, but we're testing a regression
+ // The trailing text (`Hello`) shouldn't be consumed by the element!
+ code: `
+ ${$$maybeRenderHead($$result)}
+
+
+ ${content}
+
+ ${
+ (
+ $$render` + BACKTICK + `
+ 1
+ ` + BACKTICK + `
+ )
+ } Hello
+
+`,
+ },
+ },
{
name: "table expressions (no implicit tbody)",
source: `---
@@ -1977,13 +2021,6 @@ const items = ["Dog", "Cat", "Platipus"];
code: `${$$maybeRenderHead($$result)}`,
},
},
- {
- name: "table expression with trailing div",
- source: `Div
`,
- want: want{
- code: `${$$maybeRenderHead($$result)}Div
`,
- },
- },
{
name: "tbody expressions",
source: `---