From 41a56e95ef93e8938c0d64dd1d01d6b505ab43ee Mon Sep 17 00:00:00 2001 From: Jianling Zhong Date: Wed, 26 Mar 2025 20:35:23 -0700 Subject: [PATCH] fix(source): remove leading number in title of Product Hunt (#90) This removes the duplicated numbers on the UI. --- server/sources/producthunt.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/sources/producthunt.ts b/server/sources/producthunt.ts index 321ccca..8ca5284 100644 --- a/server/sources/producthunt.ts +++ b/server/sources/producthunt.ts @@ -10,7 +10,7 @@ export default defineSource(async () => { $main.each((_, el) => { const a = $(el).find("a").first() const url = a.attr("href") - const title = $(el).find("a[data-test^=post-name]").text() + const title = $(el).find("a[data-test^=post-name]").text().replace(/^\d+\.\s*/, '') const id = $(el).attr("data-test")?.replace("post-item-", "") const vote = $(el).find("[data-test=vote-button]").text() if (url && id && title) {