View Single Post
Old 01-22-2019, 10:23 PM   #36
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,231
Karma: 35158061
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
Oh, I forgot to mention --- a possible alternative to preventing line-wrap. (<pre> is really not ideal, as JSWolf notes).

Over a year ago, there was a discussion to try to prevent emdashes at end of sentences from orphaning themselves on a separate line. RbnJrg found a solution that will also prevent single words or phrases from breaking up.

https://www.mobileread.com/forums/sh...ghlight=nowrap

See Ruben's solution, post # 17.

Quote:
Originally Posted by RbnJrg View Post

Try using the following code:

1. In your .css stylesheet:

Code:
.nowrap {
    text-indent: 0;
    display: inline-block;
}
2. In your .xhtml files

Code:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Etiam <span class="nowrap">T—</span> imperdiet leo metus, et gravida lacus.  Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula. Praesent orci dui, pulvinar id convallis a, faucibus non mauris. Donec tellus augue, tempus sed facilisis sed, fringilla quis leo.</p>
To test the code, add "." after the word nunc. (ie. nunc.., nunc..., etc.) You'll see that the T— always remains joined.

It works under ADE 3 and upper (I suppose also it should work under ADE 2).

Regards
Rubén

I have successfully used this css ever since for short words, but on long words or phrases, it can do bad things to justification and hyphenation.
GrannyGrump is offline   Reply With Quote