From 4a96c79514451c29d19fc2e7ac5d86578c617647 Mon Sep 17 00:00:00 2001 From: Makito Date: Sun, 8 Oct 2023 01:40:51 +0800 Subject: [PATCH] fix(assets): add the missing `await` to getHTMLAttributes --- .changeset/young-taxis-battle.md | 5 +++++ packages/astro/src/assets/internal.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/young-taxis-battle.md diff --git a/.changeset/young-taxis-battle.md b/.changeset/young-taxis-battle.md new file mode 100644 index 000000000000..66d0ad1d453f --- /dev/null +++ b/.changeset/young-taxis-battle.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix an issue where HTML attributes do not render if getHTMLAttributes in an image service returns a Promise \ No newline at end of file diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 9cb48f5884cd..310b746a844e 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -111,7 +111,7 @@ export async function getImage( src: imageURL, attributes: service.getHTMLAttributes !== undefined - ? service.getHTMLAttributes(validatedOptions, imageConfig) + ? await service.getHTMLAttributes(validatedOptions, imageConfig) : {}, }; }