User:Phlsph7/Readability.js: Difference between revisions

Content deleted Content added
change order
filter problematic sentences
Line 62:
innerHTML = removePlaceholders(innerHTML, periodExceptions);
paragraph.innerHTML = innerHTML;
// The last span-element is not a sentence.
/*
var spans = paragraph.getElementsByTagName("span");
if (spans.length > 0) {
spans[spans.length - 1].classList.remove("sentence");
}*/
 
function getSpanStartTag(){
Line 113 ⟶ 106:
let sentenceText = getSentenceText(sentenceElement);
let score = getSentenceScore(sentenceText);
if(!isNaN(score)){
sentenceElement.title = `Score: ${score.toFixed(2)}`;
sentenceElement.classListtitle = `Score: ${score.addtoFixed(getScoreClass(score, scoreClasses)2)}`;
sentenceElement.classList.add(getScoreClass(score, scoreClasses));
}
else{
spans[spans.length - 1]sentenceElement.classList.remove("'sentence"');
/*}
}