From bb013ddd18787a51ec5f8a24ce34b1aeae210df8 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 12 Dec 2022 20:58:03 +0000 Subject: [PATCH] fix: expand og:image regexp --- server/api/og-image/[url].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/api/og-image/[url].ts b/server/api/og-image/[url].ts index db484128..126abda2 100644 --- a/server/api/og-image/[url].ts +++ b/server/api/og-image/[url].ts @@ -18,8 +18,8 @@ function getOpenGraphClient(): OpenGraphClient { } function extractOgImageUrl(html: string): string { - const match = html.match(//) - return match?.[1] ?? '' + const match = html.match(/]*property="og:image"[^>]*content="([^"]+)"|]*content="([^"]+)"[^>]*property="og:image"/) + return match?.[1] ?? match?.[2] ?? '' } async function resolveOgImageUrlManually(cardUrl: string): Promise {