0
votes

I use CKEditor to insert some content in 'wysiwyg' mode. I input Hello, world! in the editor, and the real context inserted into database is <p>Hello, world!</p>.

Now I load the data from database and set it into CKEditor:

String content = loadFromDb();
// --> <p>Hello, world!</p>
CKEditor.instances['test'].setData(content);

But in the CKEditor, it shows:

<p>Hello, world!</p>

in 'wysiwyg' mode. When I click 'source' button, it shows:

<p> &lt;p&rt;Hello, world!&lt;/p&gt;</p>

How can I set the data as html code, and I can see only Hello, world! in CKEditor on 'wysiwyg' mode?

1

1 Answers

1
votes

Did you try simply using the insertHtml command? If you are loading it into a blank editor or not it should do the right thing. There is a function that strips off the tags too, bujt I don't recall that right now...