diff --git a/.changeset/cold-bobcats-shave.md b/.changeset/cold-bobcats-shave.md
new file mode 100644
index 000000000000..ac05fde494f4
--- /dev/null
+++ b/.changeset/cold-bobcats-shave.md
@@ -0,0 +1,5 @@
+---
+"astro": patch
+---
+
+Applies the correct escaping to identifiers used with `transition:name`.
diff --git a/packages/astro/e2e/fixtures/view-transitions/src/components/Layout.astro b/packages/astro/e2e/fixtures/view-transitions/src/components/Layout.astro
index ef82078e78f5..8643f273fd51 100644
--- a/packages/astro/e2e/fixtures/view-transitions/src/components/Layout.astro
+++ b/packages/astro/e2e/fixtures/view-transitions/src/components/Layout.astro
@@ -22,6 +22,7 @@ const { link } = Astro.props as Props;
+