getting selected text & text indexes in a <pre> tag, where the offset is the start of the pre
<p>So i have a pre tag like so:</p>

<pre><code>&lt;pre&gt; Some content, more content. &lt;span&gt;Coloured content&lt;/span&gt;. Some more content&lt;/pre&gt;
</code></pre>

<p>What i want to do is setup an event using javascript or jquery that binds a mouseup event. When the user selects text, i want to get the indexes offset from the start of the pre, so it ignores the span tags per say. So if someone selects the text after the span tag, it knows to offset from the pre opening.</p>

<p>Is there a way I can do this? It looks like window.getSelection starts it off after the span tag.</p>
