Quote:
Originally Posted by HarryT
As Jon says, a dash is (or at least should always be) a valid point at which to break a line. Can you give an example of a situation in which you'd want a non-breaking dash?
|
I'd imagine that the reason for the question is that some renderers (Kindle, iBooks, and anything else based on WebKit) incorrectly allow wrapping before an em dash. It is acceptable to wrap after one, but wrapping before it is considered poor typography.
The answer to your question is appallingly complex because old kindles don't support zero-width non-breaking space characters (displayed as a box). Otherwise, you could fix this trivially.
Instead, I've done this:
Code:
<span class="kf8only">& #65279;</span>
without the space (working around a forum bug), where the kf8only class is display:none for MOBI readers, or inline for KF8.
It works for me in limited testing, though it is unholy ugly. For EPUB books, I use the same entity without the span so that iBooks will do the right thing.
YMMV.