MediaWiki:Common.js: Difference between revisions

No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1,440: Line 1,440:
});
});
/*--------------------------------02-07-2027-----------------------------------*/
/*--------------------------------02-07-2027-----------------------------------*/
$(function () {
    $('.poem p').each(function () {
        var $p = $(this);
        // Only process paragraphs containing a floated right span
        if (!$p.find('span[style*="float:right"]').length) {
            return;
        }
        // Find the first real child node (ignore whitespace text nodes)
        var node = this.firstChild;
        while (node && node.nodeType === 3 && !node.nodeValue.trim()) {
            node = node.nextSibling;
        }
        // Remove one leading BR only
        if (node && node.nodeName === 'BR') {
            node.remove();
        }
    });
});