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(" | "); });