I have a div that is part of a custom web part. Once a user clicks an edit-button I want the div to turn into a rich text field to allow the user to edit the contents as they would edit any rich text field in a page.
Currently I'm able to create the rich text field using:
RTE.Canvas.makeRegionEditable($('editorDiv')[0]);
But when the user tries to insert an ordered or unordered list (or apply indentation) from the ribbon the dom breaks. The rich text editor element is moved up two nodes in the hierarchy and some of the surrounding dom nodes are duplicated.
How can I fix this?