From c0bed9b8aeea907e42782b8714dd566169a9065a Mon Sep 17 00:00:00 2001 From: huqi Date: Thu, 10 Mar 2022 14:13:47 +0800 Subject: [PATCH] fixed #7 --- toutiao-search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toutiao-search.ts b/toutiao-search.ts index 0efd7ac14c..2bad11a32f 100644 --- a/toutiao-search.ts +++ b/toutiao-search.ts @@ -33,7 +33,7 @@ if (await exists(fullPath)) { } const _words = words.map((x) => { - x.url = `https://so.toutiao.com/search?keyword=${x.word.replace(" ", "+")}`; + x.url = `https://so.toutiao.com/search?keyword=${x.word.replace(/(^\s+)|(\s+$)|\s+/g,'%20')}`; return x; });