4,408
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 109: | Line 109: | ||
$('#related-articles').html(relatedArticlesHtml); | $('#related-articles').html(relatedArticlesHtml); | ||
if (relatedArticlesHtml) { | // Check if the related-articles div has content and add a label | ||
if (relatedArticlesHtml && relatedArticlesHtml.trim().length > 0) { | |||
$('#related-articles').html('<h3>Related Articles</h3>' + relatedArticlesHtml).show(); | |||
} else { | } else { | ||
$('#related-articles').html('<p>No related articles found.</p>').show(); | |||
} | } | ||