mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-05-18 03:12:45 +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
|
||||
})
|
||||
|
||||
return matchWords(text).length
|
||||
let count = 0
|
||||
try {
|
||||
count = matchWords(text).length
|
||||
} catch (err) {}
|
||||
return count
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue