EE: Widon’t plugin
Low Widon’t — an ExpressionEngine plugin based on Shaun Inman’s neat little plugin for Wordpress. This post now provides a place for support for the Low Widon’t plugin.
Download and docs for Low Widon’t can be found in the Software section
Comments
Wow, I never knew there was a name for such a thing, but I sure have been annoyed by it for a while. Now that I know what it’s called I feel inspired to implement a similar hack on my own site :)
Why not use
white-space: nowrapon title headings?@Nick: heh, the same question was asked over at Shaun’s site. The point is, we just want the last two words to stick together, not the whole line/title/text. That way the width of your layout (often more important than the height) will be safe.
Hi there,
Great plugin but i’d like to mention a small change to the regular expression that is needed if any of your titles/strings end with any sort of punctuation.
Instead of |\s+(\w+)$| which matches any whitespace followed by any word character(s) use |\s+(\S+)$| which matches any whitespace followed by any non whitespace (visible) character. This has the benefit of also pairing and ending such as “my entry !!”.
GREAT Plugin! Thanks so much!!
Hi! Thanks for making this.
Just wondering why you limited it to titles though? It would be really useful on other paragraphs too.
Wanted to let you know that the plugin (EE version) was failing when there was trailing punctuation on a title (or anything, really.)
For example, the title:
My Very Very Happy
Birthday!
would not fix itself because of the final punctuation.
I modified the regex to:
(”|\s+(\w+[^A-Za-z0-9\n]*)$|”, ‘ \1′, rtrim($str));</pre>
…and it seems to stop this particular failure.
FYI, and thanks for a great port!
Just noticed Dan’s post from (urgh) 2 years ago that I somehow missed. His is probably the more elegant regex, if elegance is important to you and all, sissy-coders!
;-)