ckeditor inline editing appending some classes a role and other stuff to my div -
how prevent or remove stuff ckeditor adding divs when doing inline editing.
when load page div looked this:
<div contenteditable="true">
after used ckeditor edit content in div , used ajax save content save edits div looked this:
<div contenteditable="true" class="cke_editable cke_editable_inline cke_contents_ltr" tabindex="0" spellcheck="false" style="position: relative; " role="textbox" aria-label="rich text editor, editor1" title="rich text editor, editor1" aria-describedby="cke_56">
you can't this. these attributes internal , required ckeditor run, identify elements, provide accessibility , fix bugs. there until call editor.destroy()
.
additionally, approach must little bit wrong since have editor's container in output. correct way editor's data is:
ckeditor.instances.yourinstancename.getdata();
this content filtered , fixed. if want add container output, use following determine tag name , concatenate strings manually:
var data = ckeditor.instances.yourinstancename.getdata(), container = ckeditor.instances.yourinstancename.container.getname(); console.log( '<' + container + '>' + data + '</' + container + '>' );
Comments
Post a Comment