jackrabbit-d
10/18/2017 - 1:30 PM

Orphanizer

jquery required.

This is where your content goes that would be sent to the next line

function orphanize(){
    $(".orphan").each(function() {
        let txt = $(this).html().trim().replace(' ',' ');
        let wordArray = txt.split(" ");
        if (wordArray.length > 1) {
            wordArray[wordArray.length-2] += " " + wordArray[wordArray.length-1];
            wordArray.pop();
            $(this).html(wordArray.join(" "));
        }
    });
};
orphanize()