Skip to content

Commit 42cb647

Browse files
ematipicoastrobot-houston
authored andcommitted
[ci] format
1 parent 211968c commit 42cb647

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/integrations/markdoc/src/content-entry-type.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ async function emitOptimizedImages(
305305
},
306306
) {
307307
for (const node of nodeChildren) {
308-
let isComponent = (node.type === 'tag' && node.tag === 'image') || (node.type === 'image' && ctx.hasDefaultImage);
308+
let isComponent =
309+
(node.type === 'tag' && node.tag === 'image') ||
310+
(node.type === 'image' && ctx.hasDefaultImage);
309311
// Support either a ![]() or {% image %} syntax, and handle the `src` attribute accordingly.
310312
if ((node.type === 'image' || isComponent) && typeof node.attributes.src === 'string') {
311313
let attributeName = isComponent ? 'src' : '__optimizedSrc';

packages/integrations/markdoc/test/image-assets.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const imageAssetsCustomFixture = new URL('./fixtures/image-assets-custom/', impo
88

99
describe('Markdoc - Image assets', () => {
1010
const configurations = [
11-
[imageAssetsFixture, 'Standard default image node rendering'],
12-
[imageAssetsCustomFixture, 'Custom default image node component'],
11+
[imageAssetsFixture, 'Standard default image node rendering'],
12+
[imageAssetsCustomFixture, 'Custom default image node component'],
1313
];
1414

1515
for (const [root, description] of configurations) {
@@ -88,7 +88,10 @@ describe('Markdoc - Image assets', () => {
8888
it('transforms aliased image paths to optimized path', async () => {
8989
const html = await baseFixture.readFile('/index.html');
9090
const { document } = parseHTML(html);
91-
assert.match(document.querySelector('#alias > img')?.src, /^\/_astro\/cityscape.*\.webp$/);
91+
assert.match(
92+
document.querySelector('#alias > img')?.src,
93+
/^\/_astro\/cityscape.*\.webp$/,
94+
);
9295
});
9396

9497
it('passes images inside image tags to configured image component', async () => {

0 commit comments

Comments
 (0)