diff --git a/packages/astro/src/runtime/server/render/util.ts b/packages/astro/src/runtime/server/render/util.ts index 6c5080367d..817ca5c324 100644 --- a/packages/astro/src/runtime/server/render/util.ts +++ b/packages/astro/src/runtime/server/render/util.ts @@ -92,7 +92,9 @@ Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the // support object styles for better JSX compat if (key === 'style' && !(value instanceof HTMLString)) { if (Array.isArray(value) && value.length === 2) { - return markHTMLString(` ${key}="${toAttributeString(`${toStyleString(value[0])};${value[1]}`, shouldEscape)}"`); + return markHTMLString( + ` ${key}="${toAttributeString(`${toStyleString(value[0])};${value[1]}`, shouldEscape)}"` + ); } if (typeof value === 'object') { return markHTMLString(` ${key}="${toAttributeString(toStyleString(value), shouldEscape)}"`); diff --git a/packages/astro/test/astro-directives.test.js b/packages/astro/test/astro-directives.test.js index 9b90d59bf6..2a86e4ba2c 100644 --- a/packages/astro/test/astro-directives.test.js +++ b/packages/astro/test/astro-directives.test.js @@ -61,7 +61,9 @@ describe('Directives', async () => { expect($('style')).to.have.lengthOf(0); // Inject style attribute on top-level element in page - expect($('#compound-style').attr('style').toString()).to.include('color:var(--fg);--fg: black;--bg: white;'); + expect($('#compound-style').attr('style').toString()).to.include( + 'color:var(--fg);--fg: black;--bg: white;' + ); }); it('set:html', async () => {