2,874
edits
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
// Function to get the introductory paragraph | // Function to get the introductory paragraph | ||
function getIntroText(content) { | |||
var $content = $('<div>').html(content); | |||
// Try to find the first paragraph or other elements | |||
var $intro = $content.find('p, ul, ol, table').first(); | |||
if ($intro.length > 0) { | |||
return $intro.html(); | |||
} | } | ||
// If no suitable content is found, return a default message | |||
return '<p>No introductory text available.</p>'; | |||
} | |||
// Modify the popup content | // Modify the popup content |
edits