diff --git a/packages/yoastseo/src/scoring/assessments/readability/ListAssessment.js b/packages/yoastseo/src/scoring/assessments/readability/ListAssessment.js index 487242178ca..ac2b9441b09 100644 --- a/packages/yoastseo/src/scoring/assessments/readability/ListAssessment.js +++ b/packages/yoastseo/src/scoring/assessments/readability/ListAssessment.js @@ -47,13 +47,17 @@ export default class ListAssessment extends Assessment { */ findList( paper ) { const foundLists = paper.getTree().findAll( node => node.name === "ul" || node.name === "ol" ); - /* - This is a helper function to check if a list is not empty. - A list is not empty if it has at least one
  • child with text. - */ - const isListNotEmpty = list => list.childNodes.some( child => child.name === "li" && child.childNodes.length ); - return foundLists.some( isListNotEmpty ); + for ( const list of foundLists ) { + for ( const child of list.childNodes ) { + // A list is not empty if it has at least one
  • child with text. + if ( child.name === "li" && child.childNodes.some( node => node.name === "p" ) ) { + return true; + } + } + } + + return false; } /**