title: How to prevent a line break between text elements where there is no whitespace
body: <p>I'm trying to keep two text elements from being split apart by line breaks in an epub file (xhtml and css).</p>
  
  <p>Example:</p>
  
  <blockquote>
    <p>This is a line of text that reaches the end of the display and <sup>[12]</sup>what I don't want is for that superscripted part to be separated from the next word.</p>
  </blockquote>
  
  <p>Which ends up looking like this:</p>
  
  <blockquote>
    <p>This is a line of text that reaches the end of the display and <sup>[12]</sup><br>
    what I don't want is for that superscripted part to be separated<br>
    from the next word.</p>
  </blockquote>
  
  <p>I would like it to look like this:</p>
  
  <blockquote>
    <p>This is a line of text that reaches the end of the display and<br>
    <sup>[12]</sup>what I don't want is for that superscripted part to be<br>
    separated from the next word.</p>
  </blockquote>
  
  <p>Some software on my pc keeps the superscripted <code>&lt;sup&gt;[12]&lt;/sup&gt;</code> and the <code>what</code> together, but my Sony ebook reader doesn't. Other e-readers may do the same. I'd like it to consistently keep the superscripted part together with the next word and avoid a line break between them.</p>
  
  <p>I've looked at quite a few similar questions, but can't find anything that matches this problem.</p>
  
  <p>I'd prefer to deal with this problem via css, rather than editing a huuuuuge bunch of files by adding tags throughout it, which would be further complicated by the fact that the word after each superscripted part can be any word, ruling out a simple search and replace.</p>
  
  <p>In a similar vein, I'd also like to extend the "keeping things together" bit when the next word is "I" or "A" or "a" or any short 2-letter word, so a sentence like</p>
  
  <blockquote>
    <p>bla bla bla bla bla bla bla bla bla bla <sup>[35]</sup>in the simplest way imaginable.</p>
  </blockquote>
  
  <p>would line break in either of these ways:</p>
  
  <blockquote>
    <p>bla bla bla bla bla bla bla bla bla bla <sup>[35]</sup>in the<br>
    simplest way imaginable.</p>
    
    <p>bla bla bla bla bla bla bla bla bla bla<br>
    <sup>[35]</sup>in the simplest way imaginable.</p>
  </blockquote>
  
  <p>but NOT break like:</p>
  
  <blockquote>
    <p>bla bla bla bla bla bla bla bla bla bla <sup>[35]</sup><br>
    in the simplest way imaginable.</p>
    
    <p>bla bla bla bla bla bla bla bla bla bla <sup>[35]</sup>in<br>
    the simplest way imaginable.</p>
  </blockquote>
  
  <p>Is there perhaps a way to set some margin property or whatever so that any superscript tag must be a minimum distance removed from the right hand margin, or else it will be moved to the next line? I could then set that minimum distance to encompass the tagged part plus an additional 2 or 3 character widths.</p>
  
  <p>Something like the <code>page break after : avoid;</code> property but working at the line (not page) level would be great. Or even an <code>orphan: 5;</code> type property for lines might do the trick.</p>
  
  <p>I'm thinking (and hoping) that both the problems I've outlined above can have one and the same solution.</p>