You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The additional html/head/body results in wrong count both for words and chars.
I've fixed it here by extracting the body content with search and substring, but there may be better ways of fixing it.
var i = text.search(new RegExp("<body>", "i"));
if (i != -1) {
var j = text.search(new RegExp("</body>", "i"));
text = text.substring(i+6, j);
}
...
if (normalizedText.trim().length) {
normalizedText = strip(normalizedText);
wordCount = normalizedText.split(/\s+/).length;
}
The text was updated successfully, but these errors were encountered:
The additional html/head/body results in wrong count both for words and chars.
I've fixed it here by extracting the body content with search and substring, but there may be better ways of fixing it.
The text was updated successfully, but these errors were encountered: