mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-06-15 17:04:33 +12:00
Handle errors in word counter. Fixes #17
This commit is contained in:
parent
035ff350b4
commit
d30b18fca6
|
@ -8,5 +8,9 @@ export default function htmlWordCount (html) {
|
||||||
ignoreHref: true
|
ignoreHref: true
|
||||||
})
|
})
|
||||||
|
|
||||||
return matchWords(text).length
|
let count = 0
|
||||||
|
try {
|
||||||
|
count = matchWords(text).length
|
||||||
|
} catch (err) {}
|
||||||
|
return count
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue