Splitting and joining <li>s

A problem that I regularly have to deal with (typically turning a text  
file into HTML) is what happens when splitting <li>s.

Take this situation (| is the cursor positioned before "two" within an  
<li>). I want to split the <li> into two <li>s:

	* One |two
	* Three

1. hit return

	* One
	  |two
	* Three

2 So far so good; this I expect. Hit return again (here is where it goes  
wrong):

	* One
	  |
	  two
	* Three

3 This is not what I had expected. However, hit return again:
	* One
	* |
	* two
	* Three

4 Now you have to do a backspace:

	* One |
	* two
	* Three

And you have the result I wanted. I would expect that hitting return in  
step 2 would give me step 4.

The reverse, joining two <li>s works exactly as I would expect it to work.  
Starting from step 4:

* One
* |two
* Three

Hitting backspace gives step 2:

* One
   |two
* Three

Backspace again give step 1:

* One two
* Three

So in short, I would like these two (splitting and joining) to work  
symmetrically.

Thanks!

Best wishes,

Steven Pemberton

Received on Monday, 7 September 2009 13:52:25 UTC