From 4c455368695c35de2e731aaf3ed0e2c5a9b96d96 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Sun, 8 Oct 2023 11:32:46 +0300 Subject: [PATCH] Fix incomplete multi-character sanitization --- src/lib/wpapi.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/wpapi.mts b/src/lib/wpapi.mts index 0fbaab39..e1b9c36f 100644 --- a/src/lib/wpapi.mts +++ b/src/lib/wpapi.mts @@ -31,7 +31,7 @@ export async function getPosts(baseUrl: string): Promise { id: post.id, link: post.link, title: post.title.rendered, - excerpt: post.excerpt.rendered.replace(/<[^>]+>/gu, ''), + excerpt: post.excerpt.rendered.replace(/<[^>]+(>|$)/gu, ''), featuredMedia: post.featured_media, }), );