Hi,
I am writting my program using Eclipse RCP. Now I want to get data from CKEditor and set it back to CKEditor when some event occurred. The problem is when I get data from CKEditor (using CKEditor.getData()) the data is in raw format which has '\n' as a line break. When I set the data back I call Browser.execute(), which is Eclipse code to run javascript, the text added to javascript code contains a line break and make the javascript invalid. I tried to replace \n with br but the result get from CKEditor.getData() after I set the data back still contains \n and along with <br />.
Is there anyway to execute the setData() with the text with line break? or is there any other way to solve this problem?
My code look like this
browser.execute("CKEDITOR.instances.content.setData('" + value + "')");
but by value contains line break, the script cannot be executed.
I am writting my program using Eclipse RCP. Now I want to get data from CKEditor and set it back to CKEditor when some event occurred. The problem is when I get data from CKEditor (using CKEditor.getData()) the data is in raw format which has '\n' as a line break. When I set the data back I call Browser.execute(), which is Eclipse code to run javascript, the text added to javascript code contains a line break and make the javascript invalid. I tried to replace \n with br but the result get from CKEditor.getData() after I set the data back still contains \n and along with <br />.
Is there anyway to execute the setData() with the text with line break? or is there any other way to solve this problem?
My code look like this
browser.execute("CKEDITOR.instances.content.setData('" + value + "')");
but by value contains line break, the script cannot be executed.