View Single Post
Old 03-23-2016, 07:56 PM   #50
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by HarryT View Post
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.

Last edited by dgatwood; 03-24-2016 at 02:33 PM.
dgatwood is offline   Reply With Quote