Widon't and Widows
Shaun Innman posted about a technique he call's Widon't, for dealing with the widow problem on the web.
The widow problem is when you have a single word on a line by itself, at the end of a headline or paragraph. In typesetting this word is called a widow.
Man Walks On Moon
Moon is the widow in the above example. Shaun fixes this by replacing the last space with an He provides a function in PHP, but here's a simple regular expression for ColdFusion to do the same:
ReReplace(headline, " ([^ ]+)$", " \1")
It can get a bit trickier to fix this at the end of paragraphs, here's another regular expression that might work for that (need to test more):
ReReplace(text, " ([^ ]+\r?\n)", " \1", "ALL")
- Facebook API Now Requires Review for user_friends Permission
- Docker Container exited with code 137
- Why is my cron.daily script not running?
- Announcing FuseGuard Version 3
- CFSummit 2017
- Java Unlimited Strength Crypto Policy for Java 9 or 1.8.0_151
- Java 9 Security Enhancements
- Upcoming CFML Conferences in April 2017