Adjusts line breaking to avoid a short single word on the last line (also known as typographic orphans.) When `text-wrap: pretty` is specified, paragraphs that will end up with a short single word on the last line are adjusted so that the last line has two or more words. It also adjusts hyphenation if consecutive hyphenated lines appear at the end of a paragraph. The algorithm is based on the Knuth-Plass algorithm, as used by TeX. It computes scores for all candidates, and chooses the best one. To balance between the typographic benefits and the performance impacts, it adjsuts the last 4 lines of paragraphs that meet certain conditions.
Docs: https://docs.google.com/document/d/1jJFD8nAUuiUX6ArFZQqQo8yTsvg8IuAq7oFrNQxPeqI/edit?usp=sharing
Samples: https://output.jsbin.com/hopejeb