diff --git a/packages/astro/src/runtime/server/escape.ts b/packages/astro/src/runtime/server/escape.ts index 52c9281862..a0482fdf20 100644 --- a/packages/astro/src/runtime/server/escape.ts +++ b/packages/astro/src/runtime/server/escape.ts @@ -17,7 +17,7 @@ ${string}`); // Return unescaped content for now. To be removed. return string; -} +}; /** * RawString is a "blessed" version of String @@ -25,8 +25,8 @@ ${string}`); */ export class UnescapedString extends String {} -/** - * unescapeHTML marks a string as raw, unescaped HTML. +/** + * unescapeHTML marks a string as raw, unescaped HTML. * This should only be generated internally, not a public API. * * Need to cast the return value `as unknown as string` so TS doesn't yell at us. diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index ae4994ecde..9d9fd076a2 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -237,7 +237,9 @@ If you're still stuck, please open an issue on GitHub or join us at https://astr // as a string and the user is responsible for adding a script tag for the component definition. if (!html && typeof Component === 'string') { html = await renderAstroComponent( - await render`<${Component}${spreadAttributes(props)}${unescapeHTML((children == null || children == '') && voidElementNames.test(Component) ? `/>` : `>${children}`)}` + await render`<${Component}${spreadAttributes(props)}${unescapeHTML( + (children == null || children == '') && voidElementNames.test(Component) ? `/>` : `>${children}` + )}` ); }