From 2ddfc6610411817411be76f2149d49637e3dafad Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Tue, 30 Mar 2021 09:54:00 +0200 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9F=90=E4=BA=9B=E7=BD=91?= =?UTF-8?q?=E5=9D=80=E8=BF=94=E5=9B=9E=E5=88=86=E7=B1=BB=E9=87=8C=E5=90=AB?= =?UTF-8?q?=E6=9C=89{}=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/site/tools.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/site/tools.js b/src/lib/site/tools.js index e4bad14..12ab4c8 100644 --- a/src/lib/site/tools.js +++ b/src/lib/site/tools.js @@ -114,10 +114,12 @@ const zy = { const jsondata = json.rss === undefined ? json : json.rss const arr = [] if (jsondata.class) { + // 有些网站返回的分类名里会含有一串包含在{}内的字符串,移除掉 + const regex = /\{.*\}/i for (const i of jsondata.class.ty) { const j = { tid: i._id, - name: i._t + name: i._t.replace(regex, '') } arr.push(j) }