User:Phlsph7/Readability.js: Difference between revisions

Content deleted Content added
select only main paragraphs
simplify
Line 5:
let paragraphs = document.querySelectorAll('.mw-parser-output > p');
for(let paragraph of paragraphs){
let texttextContent = paragraph.textContent.split('\r').join('').split('\n').join('').trim();
// exclude very short paragraphs
if(texttextContent.length > 20){
// exclude a divideIntoSentences(paragraph found in vector skin);
if(!paragraph.parentElement.classList.contains('vector-limited-width-popup-body')){
divideIntoSentences(paragraph);
}
}
}