Handle errors in word counter. Fixes #17

This commit is contained in:
daniel-j 2017-04-11 22:01:25 +02:00
parent 035ff350b4
commit d30b18fca6

View file

@ -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
}