I have downloaded and installed CKEditor version 3.6.6.2 for .net and have it running on a .aspx page. If I type one word (like 'Fred') in the box and view the source it shows:
a paragraph tag on the first line
an amount of white space on the second line, then 'Fred', then the closing paragraph tag.
When I postback the page and examine what is in the textbox (CKEditor1.Text) it shows:
A paragraph tag, then '\r\n' then 'Fred' then the closing paragraph tag.
I don't understand. I thought this was supposed to be a html text editor. Why is it sticking '\r\n' inside every paragraph tag?
Check your server
Check your server configuration - this is not what CKEditor does.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
What server configuration?
What server configuration? What server configuration could suddenly start putting \r\n in a textarea when someone types a word?
There are other questions on here and other sites that say the same thing. Here is one of them http://ckeditor.com/forums/Support/SOLVED-Editor-adding-slashes-and-rn-why Have you ever installed the .net version and tried using it? I'm not on a server. I've downloaded it to a box running Windows 7 - using Visual Studio 2010. I am not the only one with this issue. I can't understand why it is not answered.
This http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting seems to indicate that this is what CKEditor does but I don't understand how to get rid of it. This code is provided there:
CKEDITOR.replace( 'editor1',
{
on :
{
instanceReady : function( ev )
{
// Output paragraphs as <p>Text</p>.
this.dataProcessor.writer.setRules( 'p',
{
indent : false,
breakBeforeOpen : true,
breakAfterOpen : false, breakBeforeClose : false,
breakAfterClose : true
});
}
}
});
but what is 'CKEDITOR' a reference to? All I have on my page is:
<CKEditor:CKEditorControl ID="CKEditor1" runat="server"></CKEditor:CKEditorControl>
If I add the code above to my page, not suprisingly, when it is run it says CKEDITOR is not defined.
Other questions suggest modifying the config.js file and put config.FormatOutput = false; in there. I have tried this. It makes no difference.
CKEditor most definitely 'does do that'
Okay, I managed to get the javascript code (the CKEditor.Replace stuff, above) working - by copying from one of the sample files.
So, to be clear, if you don't want CKEditor to stick \r\n in, and after, every paragraph tag - you need to include that bit of javascript. Seems an odd thing to me - surely not putting \r\n inside tags should be the default.
One weird thing - if I run the page without the javascript that calls set.Rules (on dataProcessor.writer) - i.e. with \r\n appearing all over the place - it submits okay when I post the page back. If I include the javascript, so I get 'clean' html - it is treated as a dangerous request and I have to set ValidateRequest="false" (asp.net thing).