I use Google Chrome.
I need to have a very tiny HTML editor and I found Simple Edit. Very small editor, just for my needs. However… This and many other editors that are using Content Editable have one common problem.
Problem
After creating a list (hit enter twice on last list item), it creates a new div. Expected to me would be to create a new paragraph tag.
Links
- Try the editor here: http://files.inlovewithcss.com/simple-edit/
- Look at the tiny source code: https://github.com/mlabod/simple-edit/blob/master/editor.jquery.js
Question
What is the correct way of prevent divs, and instead add paragraph tags after a list?
The answer posted by Bryan Allo did not take into account that you need to place the cursor at the end of the div. Otherwise upon every replace action the user would have to hit CTRL-End.
This is the solution I propose, also to be seen in action at http://jsfiddle.net/82dS6/: