HTML in browsers provide space based wrap support. Alternatively in custom layout we may need a letter based wrap behaviour. In other words content should be wrapped in the mid of word not by space.
The screenshot shows the letter wrap in html content and in normal text.

In the example the HTMLEditorKit was extended and behaviour of paragraph and text views was changed. Labels provide good break weight for all cases which means we can break label in every necessary offset. Also label provides the break according to the closest position. As for paragraphs size requirements was changed to prevent min size=longest word's size behaviour.