Hello.
I am currently working on a news site, where we got rid of outdated Fckeditor and implemented latest CKeditor a couple of days ago. We are now facing a problem, which I'm not sure is a bug or a feature of this editor.
The editors who post articles from the backend first write the article in notepad in the following format:
<p>this is paragraph 1</p> <p> </p> <p>this is paragraph 2</p> <p> </p> <p>this is paragraph 3</p>
and then they post it into SOURCE of the Ckeditor. If you save the article without clicking on SOURCE button again (to switch to actual WYSIWYG), everything saves fine in the exact format that it was posted.
However, if you want to switch to WYSIWYG to, let's say bold a certain paragraph, the editor adds a new line and a tab after opening P tag, like so:
<p> this is paragraph 1</p> <p> </p> <p> this is paragraph 2</p> <p> </p> <p> this is paragraph 3</p>
As a result, on the front of the site, all paragraphs have TRIPLE the spacing they should.
I have tested it on online demo you guys have here - http://ckeditor.com/demo, exactly the same thing happens, so it's definitely not my setup. Also, this have never happened with previously used Fckeditor.
Please let me know how this can be fixed, if can be fixed at all.
Thank you in advance.
Re: BUG? CKeditor adds new line and tab space after P tag
Anyone? This is driving me crazy!
Re: BUG? CKeditor adds new line and tab space after P tag
My problem was I was using nl2br() to output. Once removed nl2br() from my code everything mirrored the editor exactly and looked great.
-
Re: BUG? CKeditor adds new line and tab space after P tag
I'm also having the same problem as described in the OP. Not sure what you mean by removing nl2br(). I'm just using the default ckeditor.
Help.
Re: BUG? CKeditor adds new line and tab space after P tag
nl2br() is not relevent to our problem imho as it's not referenced anywhere within the source of ckeditor or my code. It is for turning new lines into html br afaik.
Re: BUG? CKeditor adds new line and tab space after P tag
I've posted a question on stackoverflow and will update any progress there.
http://stackoverflow.com/questions/2547090/ckeditor-adds-unwanted-newline-to-p
Re: BUG? CKeditor adds new line and tab space after P tag
You just need to look at the docs: http://docs.cksource.com/CKEditor_3.x/D ... Formatting
But if you have problems because a newline is generated, then you'll have troubles in the long run, so you should look at your code right now.
Re: BUG? CKeditor adds new line and tab space after P tag
This is for a news website where the content of the text area is transformed by designers who don't want these newlines. The code has no trouble with keeping of parsing newlines but these are added in automatically and not on request.
What troubles in the long run do you speak of?
code change to htmlwriter plugin:
Re: BUG? CKeditor adds new line and tab space after P tag
So asking how to change it because you like it most the other way it's ok, it's a matter of taste; but if it's because they are causing some problem in your site, means that you have a bug in your site.