From 8633eca37dff6e9a759e5b3f4420d33945b8a8d2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 14 Mar 2024 19:09:00 -0500 Subject: [PATCH] cardSchema: take innerHTML instead, force type to 'link' if html is empty --- src/schemas/card.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/schemas/card.ts b/src/schemas/card.ts index f28b5eee64..dc4ba2e6b2 100644 --- a/src/schemas/card.ts +++ b/src/schemas/card.ts @@ -76,7 +76,11 @@ const cardSchema = z.object({ } }); - card.html = html.outerHTML; + card.html = html.innerHTML; + + if (!card.html) { + card.type = 'link'; + } return card; });