|
|
|
@ -375,8 +375,13 @@ Readability.prototype = {
|
|
|
|
|
curTitle = origTitle.substring(origTitle.lastIndexOf(':') + 1);
|
|
|
|
|
|
|
|
|
|
// If the title is now too short, try the first colon instead:
|
|
|
|
|
if (wordCount(curTitle) < 3)
|
|
|
|
|
if (wordCount(curTitle) < 3) {
|
|
|
|
|
curTitle = origTitle.substring(origTitle.indexOf(':') + 1);
|
|
|
|
|
// But if we have too many words before the colon there's something weird
|
|
|
|
|
// with the titles and the H tags so let's just use the original title instead
|
|
|
|
|
} else if (wordCount(origTitle.substr(0, origTitle.indexOf(':'))) > 5) {
|
|
|
|
|
curTitle = origTitle;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (curTitle.length > 150 || curTitle.length < 15) {
|
|
|
|
|
var hOnes = doc.getElementsByTagName('h1');
|
|
|
|
|