fix(source): remove leading number in title of Product Hunt (#90)

This removes the duplicated numbers on the UI.
This commit is contained in:
Jianling Zhong
2025-03-27 11:35:23 +08:00
committed by GitHub
parent f9fea3b72e
commit 41a56e95ef
+1 -1
View File
@@ -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) {