2

Sorry if it seems an old problem, But right now, it is more than 3 hours that I am stucked in this problem and can not solve it, So please tell me how I can solve this.

I have recently added a CKEditor to a webpage. The problem is that it converts width and height attributes of the img elements to inline style. These attributes are set in server-side and I wish I keep them. I tried many possible solution, but they seems to be old.

Here is the script I used:

<script language="JavaScript"  type="text/javascript">
 CKEDITOR.config.toolbar = [
    { name: 'document', items : [ 'Source','-','Save','DocProps','Preview' ] },
    { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', '-', 'Undo', 'Redo' ] },
    { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', ] },
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
    { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
    '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
    { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar',  ] },
    { name: 'styles', items: ['Format', 'Font', 'FontSize' ] },
    { name: 'colors', items: [ 'TextColor' ] },
    { name: 'tools', items: ['Maximize', 'About' ] }
];
CKEDITOR.config.height = 500;
CKEDITOR.config.contentsLangDirection = 'rtl';

CKEDITOR.replace( 'htmlp1', {
    allowedContent:
        'img(left,right)[!src,alt,width,height];' 
} );
            </script>

Please, would you clearly tell me what should I do?

Thank you very much.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.