jquery required.
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()