Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.removeOrphans = function() {
- $(this).each(function(index, element) {
- var $element = $(element);
- var html = $element.html();
- html = html.replace(/(\s)([\S])[\s]+/g, "$1$2 ");
- $element.empty().html(html);
- });
- }
- })(jQuery);
- $(function() {
- $('p, h1, h2').removeOrphans();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement