- Content written in the editor should be valid XHTML markup
- Users should not be able to input any malicious code in our system such as JavaScript or CSS properties like position: absolute
- Content pasted in the editor contains <br /> elements as line breaks whereas we would want each line to be wrapper inside <div> element
- When pasting simple data into the editor we noticed <div> elements started to get nested
- We wanted to modify the way how CKEditor automatically indents the source code
CKEditor paste issues were bit tricky ones to be solved. CKEditor contains internal logic that single line breaks are replaced with <br /> tags and two line breaks are replaced with enterMode in case enterMode is either p or div. Once we got around this issue by doing custom paste event handling we noticed that div elements were nested in such cases where they shouldn't have been. The complete code how I solved issues three and four is available at StackOverflow.
Finally issue number five was an easy one to fix. CKEditor Developer Guide provides good documentation how to manipulate CKEditor's output formatting and we tweaked it to fit our preferences.