MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
 
Line 1,392: Line 1,392:
     $('.ekatra-right-author').each(function () {
     $('.ekatra-right-author').each(function () {


         var poem = $(this).closest('.Poem2-Ekatra');
         // Remove blank <p> inside Poem2 after author
        var p = poem.next('p');
        $(this).nextAll('p').each(function () {
            var html = $.trim($(this).html());


         if (p.find('br').length) {
            if (html === '' || html === '<br>' || html === '<br/>' || html === '<br />') {
                $(this).remove();
            } else {
                return false;
            }
        });
 
        // Remove blank <p><br></p> after Poem2 block
        var p = $(this).closest('.Poem2-Ekatra').next('p');
 
         if (p.length && p.find('br').length) {
             p.remove();
             p.remove();
         }
         }