Suppose I have a paragraph of text. The first shows what I have for a moment. The second is what I would like to have. So, this is all about words that have 3 or less letters at the end of a line. I want them to be on the verge of the next line.
I could use an indestructible cosmic entity between the words "tempor" and "ex" (etc.), but it looks like a lot of work. Since there is no CSS property for this, I thought the only reasonable way to work it was to use some JS to manage it. This way all the HTML comes from the server without inextricable lines, and then the JS code gets all the text and puts the inextricable space mark in the right places. Are there any ready-to-use libraries to control this? Is this a good way to control this? Will it be effective with huge blocks of text?

David source
share