How can I get clean xhtml from CKEditor?
If user pastes code
I want to get
out of CKEditor somehow. How to do this?
I just could not find how to run the same function which is run on CKEDITOR.replace('divId', {});
Also, if one could tell me where to define how xhtml is formatted, I would be thankful.
If user pastes code
<div>Text here</div></div>
I want to get
<div>Text here</div>
out of CKEditor somehow. How to do this?
I just could not find how to run the same function which is run on CKEDITOR.replace('divId', {});
Also, if one could tell me where to define how xhtml is formatted, I would be thankful.

Re: How to get clean XHTML?
Re: How to get clean XHTML?
CKEDITOR.instances['myEditor'].updateElement(); var content = CKEDITOR.instances['myEditor'].getData(); CKEDITOR.instances['myEditor'].setData(content, function() { content = CKEDITOR.instances['myEditor'].getData(); CKEDITOR.instances['myEditor'].destroy(); alert(content); } );This code makes sure CKEditor instance is updated before getting the (cleaned) data out of it again.