handle mixed guard and timing

This commit is contained in:
WEBXOSS 2017-01-18 15:16:07 +08:00
parent 448d5556f3
commit 03a740b258
3 changed files with 20 additions and 3 deletions

11
dist/index.js vendored
View file

@ -422,6 +422,7 @@ function toCardText(el) {
}
return node.textContent
}).join('')
return text
}
function toFaq(el) {
let faq = {}
@ -452,7 +453,15 @@ function toInfo(doc, id) {
info.limit = trs[3].children[1].textContent
info.power = trs[3].children[3].textContent
info.limiting = trs[4].children[1].textContent
info.guard = trs[4].children[3].textContent
// guard or limiting
if (trs[4].children[2].textContent === 'ガード') {
info.guard = trs[4].children[3].textContent
info.timing = '-'
} else {
info.guard = '-'
info.timing = trs[4].children[3].textContent
}
let el = doc.querySelector('.card_skill')
info.cardSkill = el? toCardText(el) : ''

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -84,7 +84,15 @@ function toInfo(doc, id) {
info.limit = trs[3].children[1].textContent
info.power = trs[3].children[3].textContent
info.limiting = trs[4].children[1].textContent
info.guard = trs[4].children[3].textContent
// guard or limiting
if (trs[4].children[2].textContent === 'ガード') {
info.guard = trs[4].children[3].textContent
info.timing = '-'
} else {
info.guard = '-'
info.timing = trs[4].children[3].textContent
}
let el = doc.querySelector('.card_skill')
info.cardSkill = el? toCardText(el) : ''