[ci] yarn format

This commit is contained in:
natemoo-re 2022-01-31 22:15:39 +00:00 committed by GitHub Actions
parent 6fe1b0279f
commit f3b35023fd
2 changed files with 6 additions and 4 deletions

View file

@ -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.

View file

@ -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}</${Component}>`)}`
await render`<${Component}${spreadAttributes(props)}${unescapeHTML(
(children == null || children == '') && voidElementNames.test(Component) ? `/>` : `>${children}</${Component}>`
)}`
);
}