mintchaos / typogrify

A set of Django template filters to make caring about typography on the web a bit easier.
http://static.mintchaos.com/projects/typogrify/
Other
168 stars 29 forks source link

`widont` on first two words #43

Open wavexx opened 9 years ago

wavexx commented 9 years ago

Similarly to what's being done on the last two words, does it make sense to put an   on the first two words at the start of each paragraph?

This would avoid starting a new paragraph in an overly narrow space which is caused by floats. See this article:

https://css-tricks.com/minimum-paragraph-widths/

Unfortunately, there's no way to control the minimal line width in flowed text. The proposed solution doesn't actually work in recent FF versions, and seems to fail in presence of relative margins in other browsers as well.

Adding an   is cheap and seems to work at least to prevent starting the text on a narrow region. It won't prevent the issue entirely if the paragraph starts with short words, but by some random trials doesn't seem to harm either.