3
votes

when setting data in CKEditor images disappear in the editor area. Links and other format is ok, so doesn't look like a double quote thing. Also, I tryed with absolute positioned and also external images, so it's not an image not found problem.

This is my code:

function getContent(id)
{
    console.log($('#content-article-' + id).html());

    return $('#content-article-' + id).html();
}
function enableEdition()
{
    if (current_conclusion != 'NEW')
    {
        $('#titular-edit').val(getTitle(current_article));

        //This setData() sets everthing but images
        CKEDITOR.instances.editor.setData(getContent(current_article));
    }
}

The image tag is substituted by a <br> tag inside the editor iframe

1
Which version of ckeditor are you using? - Dipul Patel
Last one, Version 4.1.2 • 23 Apr 2013 standard package - K. Weber

1 Answers

4
votes

CKEditor 4.1 comes with Advanced Content Filter which is the root of your problem. Most likely you don't use the image plugin that adds <img> to allowedContent rules (don't you?). This is why editor discards those tags from your content and this is why you have to configure it manually.

See related answers: Stop CKEditor removing divs, CKEditor strips inline attributes