Contenteditable spans and line breaks
Posted on 2004-08-13
Hi, I have the following HTML, the idea being that users can edit between the square brackets :
<HTML><BODY>some content [<SPAN CONTENTEDITABLE>editable text here</SPAN>] some more content</BODY></HTML>
Now, if the user presses carriage return whilst editing within the span, I would like the right hand bracket (and any other text to the right of the cursor) to drop down on to the next line, so the user can continue editing. However, this is not what happens. What actually happens is that any text to the left of the cursor within the span stays on the same line, with the remained of the span content, along with the text outside the span dropping down on to the next line.
So, say I press carriage return when the cursor is between "editable" and "text", what it looks like is this (assuming my spacing works!!) :
some content [text here] some more content
What I want it to look like is
some content [editable
text here] some more content
Can you please give me some assistance in achieving the desired result.