MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 1,442: Line 1,442:
/*----------------------------------08-07-2026----------------------------------*/
/*----------------------------------08-07-2026----------------------------------*/
/* Remove blank <p><br></p> after Author template */
/* Remove blank <p><br></p> after Author template */
$(function () {
$(function () {


     $('.ekatra-author').next('p').each(function () {
     $('.ekatra-author').next('p').each(function () {


        var $p = $(this);
        // Remove <br> first
        $p.find('br').remove();
        // If only <style> (or nothing) remains, remove the paragraph
         if (
         if (
             $(this).children('br').length &&
             $p.children().length === 0 ||
            $.trim($(this).text()) === ''
            (
                $p.children().length === 1 &&
                $p.children('style[data-mw-deduplicate]').length === 1
            )
         ) {
         ) {
             $(this).remove();
             $p.remove();
         }
         }