fix(assets): add the missing await to getHTMLAttributes (#8773)

This commit is contained in:
Makito 2023-10-08 03:22:47 +08:00 committed by GitHub
parent 30de324361
commit eaed844ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix an issue where HTML attributes do not render if getHTMLAttributes in an image service returns a Promise

View file

@ -111,7 +111,7 @@ export async function getImage(
src: imageURL,
attributes:
service.getHTMLAttributes !== undefined
? service.getHTMLAttributes(validatedOptions, imageConfig)
? await service.getHTMLAttributes(validatedOptions, imageConfig)
: {},
};
}