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 ( | ||
$( | $p.children().length === 0 || | ||
( | |||
$p.children().length === 1 && | |||
$p.children('style[data-mw-deduplicate]').length === 1 | |||
) | |||
) { | ) { | ||
$ | $p.remove(); | ||
} | } | ||