title: Strange behaviour with range.toString()
body: <p>I want to get back the text that I select in an element using the Range object provided by Mozilla's flavour of javascript.</p>
  
  <p>So I do this:</p>
  
  <pre><code>//assume that I'm only using Firefox, and there is just one selection
  var range = window.getSelection().getRangeAt(0);
  var rangeText = range.toString();
  </code></pre>
  
  <p>This works OK when the html of the selected text doesn't have any newlines In other words, if I have the following html:</p>
  
  <pre><code>&lt;div&gt;One. Two. Three. Four. Five.&lt;/div&gt;
  </code></pre>
  
  <p>and I select <strong>Two. Three. Four.</strong>, then everything is fine.</p>
  
  <p>On the other hand, if I have </p>
  
  <pre><code>&lt;div&gt;
  One.
  Two.
  Three.
  Four.
  Five.
  &lt;/div&gt;
  </code></pre>
  
  <p>and I select <strong>Two. Three. Four.</strong> as before, there are newlines introduced into the result returned from Range.toString(); the newlines are after <strong>Two.</strong>, <strong>Three.</strong>, and <strong>Four.</strong></p>
  
  <p>Obviously, when displayed in the browser, both html fragments are identical. Is there a way I can ensure that the same text is returned without newlines?</p>