From b44e1b5765676eda0859f761e8dc6d56b718fd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E8=B0=B7=E5=89=91=E4=BB=99?= Date: Fri, 14 Jun 2019 18:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=B0=8F=E6=80=AA=E7=89=A9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monsters-info/extractByNode.js | 9 +++++++-- script.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/monsters-info/extractByNode.js b/monsters-info/extractByNode.js index 881a8221..b9086f1e 100644 --- a/monsters-info/extractByNode.js +++ b/monsters-info/extractByNode.js @@ -42,9 +42,14 @@ fs.readFile('./ja.json',function(err,data){ //名字 var nameObj = { ja:m[1], - en:((m2 && !/^\*+/.test(m2[1]))?m2[1]:""), //没有数据,或者名字是星号都为空 - ko:((m3 && !/^\*+/.test(m3[1]))?m3[1]:""), + //en:((m2 && !/^\*+/.test(m2[1]))?m2[1]:""), //没有数据,或者名字是星号都为空 + //ko:((m3 && !/^\*+/.test(m3[1]))?m3[1]:""), } + if (m2 && !/^\*+/.test(m2[1])) + nameObj.en = m2[1]; + if (m3 && !/^\*+/.test(m3[1])) + nameObj.en = m3[1]; + //类型 var type = [m[5]]; if (m[6]!=-1) //第二个type diff --git a/script.js b/script.js index 221c0047..79eaecd5 100644 --- a/script.js +++ b/script.js @@ -135,7 +135,7 @@ function initialize() opt.label = m.id + " - " + language.searchlist.map(function(lc){ //取出每种语言 return m.name[lc]; }).filter(function(ln){ //去掉空值 - return ln.length>0; + return ln?(ln.length>0):false; }).join(" | "); });