Keeps words, numbers, and units together with nonbreaking spaces for web typography.
Typehug is a lightweight, dependency-free typography engine created by Aleksander Szczurek designed to prevent orphaned words, awkward line breaks, and broken units in web content. By automatically detecting short words, numeric unit pairings (such as 30 min), abbreviations, and paragraph endings, it injects Unicode nonbreaking spaces across plain text, HTML strings, and formatted text runs.