I was using ckeditor and everything was working just fine. I installed the footnotes module, and it worked, but then after a few test nodes I started noticing that when I edited or previewed my node, the spacing between paragraphs was being doubled. Now after removing the footnotes module I am still facing the same problem. When I edit/preview a node's content <p>&nbsp;</p> is placed between each paragraph. Below is some more code examples.

Initial Input

<p>
	This is test line 1</p>
<p>
	This is test line 2</p>

First Edit

<p>
	This is test line 1</p>
<p>
	&nbsp;</p>
<p>
	This is test line 2</p>

Second Edit

<p>
	This is test line 1</p>
<p>
	&nbsp;</p>
<p>
	&nbsp;</p>
<p>
	&nbsp;</p>
<p>
	This is test line 2</p>

Live example of the above output http://ivawbeta.org/webmaster/test

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bryancasler’s picture

I was able to resolve this by turning off "AutoParagraph". Not sure why it started being a problem out of the blue like this, but atleast everything seems to be working now. Will keep this thread updated if any new developments sprout up.

solutiondrop’s picture

Correct me if I'm wrong, but I remember this happens via the HTMLpurifier module when AutoParagraph is set to Yes and the "Security filters" on the CKEditor config pages uses HTMLPurifier.

bryancasler’s picture

A little update. I am running HTMLPurifier. After disabling "AutoParagraph" the problem resolved itself for a little while, then about an hour later it started cropping up again. I had been clearing my browser cache in firefox and site cache through the Admin Menu module, but to no resolve. I had noticed in my configuration settings for my filter (admin/settings/filters/1/configure) that HTMLPurifier had a button to clear it's cache. After clicking this button and clearing HTMLPurifiers cache, everything is working again! I will keep this post updated if anymore quirks regarding this pop up.

Thanks for you comment droplits, it made me go and look through all the setting again, otherwise I may have missed that button for who knows how long.

wwalc’s picture

Status: Active » Fixed

Thanks for explaining what was the problem, I have added it to troubleshooting -> http://drupal.ckeditor.com/troubleshooting#11

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

arnieswap’s picture

The same thing is happening to my site. I was using FCKeditor and move to CKEditor seems lethal as it ads these extra quotes....

arnieswap’s picture

Status: Closed (fixed) » Active
jcisio’s picture

Status: Active » Closed (fixed)

The solution was given.

TomJoad’s picture

Can anyone explain how I disable the "AutoParagraph" feature. I have tried looking for it in the ckeditor.js file but I am just not sure how you do it. I am looking for some hand holding here since I can't seem to find anything helpful on the CKEditor forum either.

It would be nice to have the instructions in the Troubleshooting link as well (http://drupal.ckeditor.com/troubleshooting#11) since right now it offers a solution but no information on how to implement it.

My Google powers have failed me.

Thanks,

bryancasler’s picture

Go to "Input Formats" /admin/settings/filters

then choose your filter of choice and click its "configure" link

now click on the configure tab

Now you can find "AutoParagraph" under the "AutoFormat" section, which is the second section from the top.

SocialNicheGuru’s picture

When I goto admin/settings/filter and click on config for "full html" for example, there is no "Auto Format" option.

bryancasler’s picture

SocialNicheGuru I wish I could tell you why that is, but I think someone more intimate with the project is going to have to explain why you might not be seeing it.

larowlan’s picture

Version: 6.x-1.0-beta1 » 6.x-1.1
Status: Closed (fixed) » Active

Hi
I can confirm this behaviour occurs without the htmlpurifier module, that is why SocialNicheGuru can't see the filter, they don't have it installed (neither do I).
I have the same behaviour.
Steps to replicate:
1) Open a node for editing
2) Hit save
3) Edit node again
4) Hit save
so on
Each edit adds additional

 

tags.
I believe this is purely Javascript related because if you click repeatedly toggle the 'Source' button in the editor, you get the same behaviour.

My config has the Enter = new p and Shift Enter = new br.
Php version 5.2.11
I don't have htmlpurifier installed.
I have tried with and without the security settings.
I have tried with and without the line break converter input filter.
I have tried with and without the core html cleanup filter.
I have tried multiple toolbar layouts.
I have tried multiple themes.

The sad thing is, I have another Drupal install on a dev server (php version 5.3) with same config for Ckeditor, same permissions, similar spread of modules but it does not have this issue with either version 6-x.1.0 or 6.x.1-1.

Any clues?

larowlan’s picture

Status: Active » Closed (fixed)

Hi
Found the issue
Bad xhtml to begin with, p's inside ul's with no parent li, other missing closing tags etc.
What is scary is that the xhtml was created by CKEditor.
Is it possible for the user to foo up the xhtml using CKEditor?
By pressing the delete key?
Is there a way to purify the output before saving the node?

DrupT’s picture

Hi,

I can confirm this behaviour occurs without the htmlpurifier module, too.

Any solutions?

Thanks

DrupT’s picture

Status: Closed (fixed) » Active
bryancasler’s picture

Oddly enough this has now become a problem again on my site. If I click in the text area a <p>&nbsp;</p> is created, even if nothing is typed.

jcisio’s picture

animelion, do you have the original issue, which was caused by the autoparagraph filter? If not, you should open a new issue.

From the recent voice, I see that this is a new one:
#13: repeatedly toggle the Source button keeps adding <p>&nbsp;</p>
#17: click in an empty textarea generates <p>&nbsp;</p>

In two cases, this evidently is a clientside problem. Thus, it could be useful to give more detail: OS, browser, other scripts in that page, and maybe, add-ons used in browser. And all that worths creating a new issue.

dczepierga’s picture

Status: Active » Closed (cannot reproduce)

I try to reproduce this in few browsers, with installed plugins which was written in this node without any result. Everything work good in DEV version from CVS and CKEditor 3.4.
In this week should be new release of CKEditor plugin.

Jcisio thx for the support, u make a really good job.

troyfandango’s picture

Status: Closed (cannot reproduce) » Active

I have a similar problem: there is always a BR tag in the MENU ITEM DESCRIPTION which I cannot remove. Its always there even when I delete and save it. It keeps putting it back in!

The only filters I have enabled for FULL HTML are:

Internal Path filter
URL Filter

I am not using htmlpurifier module either. Using drupal 6-19.

jcisio’s picture

Status: Active » Closed (cannot reproduce)

I revert the status because you have a different problem. Nobody mentioned about BR tag in this issue. Hint: you problem was reported in another issue.

wer0ckz’s picture

same problem please help..

I created a new story or article using CKeditor full HTML or filtered. I pasted the body of this content http://www.clclax.org.au/newsitem/?newsid=185 to my drupal CKeditor, before i hit saved, i can see the spaces between paragraphs, but when i hit saved and viewed the node here is what is can see http://vorlage.net.au/clclax.org.au-new/news/doug-fox-awarded-oam

how to fix?

thanks

jcisio’s picture

wer0ckz, if space is converted into &nbsp;, that's another problem.

Anonymous’s picture

This can also be caused by Firebug. When you are editing content, be sure to have Firebug disabled. You don't have to uninstall, just click the little red "power" button on the top right of the Firebug window that says, "Deactivate Firebug For this website."

I'm not using html purifier.

daveX99’s picture

I'm having this problem too. Subscribing. Can confirm it happens eventhough firebug is off. I don't have htmlpurifier, and can't find an 'auto paragraph' setting.

Running Drupal 6.19 & CKEditor 3.4.1

-dave.

bryancasler’s picture

I found this recently, might be worth looking into http://drupal.org/project/emptyparagraphkiller

jdvc’s picture

Issue tags: +&nbsp;

I think animelion is on the right track. The empty paragraph killer module is a good solution since I've found this issue usually results from a user hitting enter twice in the wysiwyg and unknowingly causing a <p>&nbsp;</p> to be inserted. Usually when a user hits enter once in the CKEditor wysiwyg, it is not really apparent that they have created another paragraph, so they'll hit it twice.

adraskoy’s picture

subscribe

newcitypro’s picture

Version: 6.x-1.1 » 6.x-1.2
Assigned: Unassigned » newcitypro
Issue tags: +<p> tags

I'm having the same problem as daveX99 ...no HTMLpurifier, can't find "auto paragraph" and running Drupal 6.20 and CKeditor 6.x-1.2. Any additional thoughts?

SlayJay’s picture

Same issue here... subscribing.

jjma’s picture

Problem same on D7 without the htmlpurifier module running. I do use firebug alot in the development of the website which might be causing this conflict although I've not seen this behaviour on other drupal sites.

Using the http://drupal.org/project/emptyparagraphkiller module to stop the pesky

tags....

Jon

Anonymous’s picture

I am also having this issue on both D7 and D6 CKEditor, latest version of the editor and module. If I paste something from Word, toggle source on and off, the empty p tags show up before the content. Annoying. The paragraph killer fixes it in the presentation view but the editor keeps the empty p tags when you go back to edit.

Anonymous’s picture

It looks like the issue is happening to me in Chrome but not in IE or Firefox. I am not using Firebug on that page.

carlos.macao’s picture

subscribing..,

tinokreutzer’s picture

Subscribing.

Not exactly the same problem here, but might be useful for illustration. For me <p>&nbsp;</p> is only added before pasted text if this text already had formatting such as H1. Seems like the <p>&nbsp;</p> part in the first line of the empty text box is not being replaced by <h1>some pasted text</h1> as it should.

So copy-pasting

<h1>some header text</h1>
<p>some paragraph text</p>

becomes

<p>&nbsp;</p>
<h1>some header text</h1>
<p>some paragraph text</p>

(This happens to virgin new documents, auto line breaks disabled, no html filters applied. Using D7 and CKeditor 3.6)

delykj’s picture

subscribing

vreddy4’s picture

I am using ckeditor and everything was working just fine. I installed the footnotes module, and it worked, but then after a few test nodes I started noticing that when I edited or previewed my node, the spacing between paragraphs was being doubled. Now after removing the footnotes module I am still facing the same problem. When I edit/preview a node's content

Sample Tesr

is placed between each paragraph.

EXample:

Sample Tesr

Sample Tesr

Sample Tesr

Anonymous’s picture

We had this problem today as well. Our template is feed from a JSON object so before outputting the content, I added this simpled line of Javascript:

var filteredbody = data[0].body.replace('<p>&nbsp;</p>', '');

No more problems.

John Pitcairn’s picture

sub

Anonymous’s picture

subscribing, this is a very annoying problem that always happens in every Drupal 7 + CKeditor I do.

SocialNicheGuru’s picture

@mpoplin where did you add the line?

mkocev’s picture

I changed settings for "Cleanup and output" on CKeditor.

Enter mode = <br>
Shift + Enter mode = <p>

Just a temporary solution :)

woodp’s picture

Version: 6.x-1.2 » 6.x-1.8
Status: Closed (cannot reproduce) » Closed (works as designed)
FileSize
3.36 KB
41.83 KB

I observed this problem as well in CCK-created text fields. The default "Text Area" widget "Text Processing" value is Plain Text. Changing it to "Filtered Text" solved my problem.

/admin/content/node-type/{CCK element}/fields/{CCK field}

jefbak2’s picture

It appears the choosing "filtered text" for the cck field means the user can select the input format. What does that mean?

dsellers’s picture

#43 worked for me.

I had to go back and delete the field from my content type and recreate it selecting "filtered text" in the widget type.

blakedesign’s picture

#42 worked for me. Not sure how or why but it worked like a charm.

cangeceiro’s picture

Version: 6.x-1.8 » 7.x-1.6
Status: Closed (works as designed) » Needs work

also experiencing this on a d7 site, no html purifier, no extra ckeditor plugins

bryancasler’s picture

Since originally posting this bug report I've moved my development to D7. I'm also using the WYSIWYG modules support for Ckeditor. I'm still experiencing the same problems though, so this is obviously not a Drupal issue, but a ckeditor one. That doesn't mean we shouldn't try and find a way to fix the experience.

I've also noticed that after returning to edit a node, sometimes a ckeditor adds <p>&nbsp;</p> to the top of the post, anyone else experience this?

So far the current suggestions are to use the empty paragraph module, play around with Ckeditor's "Cleanup and output" settings, and per #38 add some custom code to an unknown location. Are there any others I'm missing? How can we move forward with resolving this? Lets hear some ideas and suggestions.

Anonymous’s picture

Is there somewhere we can report this to CKeditor folks?

This still only happens to me in Chrome. FF seems to be fine.

John Pitcairn’s picture

The problem appears to be Webkit generally, I get this in Safari (mac) and it seems to be somewhat worse in CKEditor 3.6.x than 3.5.x.

mkesicki’s picture

@vilepickle on CKEditor tracker there are already 2 known issues about adding extra <p>&nbsp;</p> to content. Here are links to it: http://dev.ckeditor.com/ticket/1026 & http://dev.ckeditor.com/ticket/5241

bryancasler’s picture

tahiticlic’s picture

Hi,

I've experienced it on D7.10 + last version of CKeditor. And the solution was to remove "convert line break to HTML" in filter settings : admin/config/content/formats

bryancasler’s picture

@tahiticlic I've had that disabled, but the problem persist. I believe it's a webkit issue.

chiappa’s picture

For me the extra line brake is added by the rich text editor when there's divs inside a div.

So if I have for example <div>hello</div> it wont add anything below that, but if I would have <div><div>hello</div></div> it will add an extra line brake to the bottom. I tired Firefox, Opera, Chrome & Safari all with the same results.

I am using the CKEditor module and the only "fix" I found is to Edit the CKEditor profiles "EDITOR APPEARANCE" to Default state: Disabled.

If I go to the rich text editor it will continue to add the extra line brake, but when you go back to the plain text editor and remove the added line brake, it will be able to save the document as it is. The hunt for a real fix continues....

mkesicki’s picture

@chiappa can you check if the same happens when you change
"Enter mode " option to "div" in "Cleanup and output" section in CKEditor profile configuration.

chiappa’s picture

I have tried that already and now double checked that it has no effect. Also I really don't fancy using divs as a line break.

lalit774’s picture

step 1 you should search following keys in /sites/all/libraries/ckeditor/ckeditor.js and update following values

enterMode:2, forceEnterMode:true, shiftEnterMode:1

step 2. clear cache

Result:

fix this problem <p>&nbsp;</p>

in Firefox working fine.
in Chrome add <div> as place of <br>. but working fine.

bryancasler’s picture

lalit774, what's that about chrome?

lalit774’s picture

hi dear,

<p>&nbsp;</p> problem fixed in both firefox and chrome.

but in chrome ckeditor use <div> as place of <br>

tcowin’s picture

I've got D 7.0 and CKEditor 3.4.2, and while #58 had no discernible affect, #53 did prove to solve the problem described in #37.

westbywest’s picture

step 1 you should search following keys in /sites/all/libraries/ckeditor/ckeditor.js and update following values

enterMode:2, forceEnterMode:true, shiftEnterMode:1

This resolved the issue with me, although I am using CKEditor 3.6.x with the WYSIWYG module. Do note that CKEditor provides the file config.js to set options like these, so you don't have to edit ckeditor.js directly. Also the WYSIWYG module lets you override CKEditor settings in a custom module with hook_wysiwyg_editor_settings_alter(). So, I moved these config options to a module ...

/**
 * Implementation of hook_wysiwyg_editor_settings_alter()
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
    // set various CKEditor option to address problem with extra p tags being added
    $settings['enterMode'] = 2;
    $settings['forceEnterMode'] = true;
    $settings['shiftEnterMode'] = 1;

    // Example of setting customConfig option. Just note it gets overridden by values in $settings.
    //$settings['customConfig'] = 'path/to/my/config.js';
  }
}
batigolix’s picture

confirm that the solution in #62 works for CKEditor 3.6.2.7275 & Wysywig 6.x-2

Boss C’s picture

Version: 7.x-1.6 » 7.x-1.7

I've searched for two weeks trying to find a solution to this problem. Just updated to CKeditor 7.x-1.7, and still has a source outcome like this:

<p>What is it I am&nbsp;doing wrong With This&nbsp;I will not</p>

Not using WYSIWYG module, or HTMLpurifier. Has anyone found a solution to the editor inserting   (#58, #62, doesn't work)

TarKHaoS’s picture

#62 works for me!
Thanks!

Using Wysiwyg 7.x-2.1, with CKEditor library version 3.6.2.7275 .

jvieille’s picture

Same problem apparently in D6. Please backport when solved

lsolesen’s picture

Status: Needs work » Active

Setting to active as there is no patch to work on.

Summit’s picture

Hi, dd anyone try this: http://stackoverflow.com/questions/7268859/ckeditor-adds-empty-paragraph...

EDIT: I tried http://drupal.org/node/1188198 and I think it works!
EDIT 2: No this is not working either...
No solution yet to get the annoying
<p>&nbsp;</p>

greetings, Martijn

modestmoes’s picture

If you want to avoid nasty formatting, here is a possible solution.

paste this in 'custom javascript configuration'
config.autoParagraph = true;
config.forcePasteAsPlainText = true;

The reasoning behind this is: avoid any nasty formatting coming in and force user to use ckeditor to format their bullet lists, blockquotes, whatever.

Summit’s picture

Hi,
Could you tell me where I can input this please? What is the admin url?
Thanks a lot in advance for your reply!

Greetings, Martijn

dczepierga’s picture

@Summit, go to CKEditor profile -> "Advanced options" section -> Custom JavaScript configuration...
Try to paste it there ;)

Summit’s picture

Hi, Thanks did that. Now on travels, so can't tell if it is working or not within a month.
Greetings, Martijn

rinasek’s picture

#69 works just fine

akki123’s picture

Problem still appears with latest version of Wysiwyg and CKEditor. No fix resolved this issue.

I switched to TinyMCE and problem disappeared.

Summit’s picture

Hi, I do not think that switching to TinyMCE is the solution.
Could anybody may be post a solution for latest version?

Thanks a lot in advance for your reply!
greetings, Martijn

Dentorat’s picture

#62 works for me, but I wasn't a fan of switching the behaviour of the enter key, instead of setting enterMode, I set just the one below and it worked like a charm

$settings['autoParagraph'] = false;

Shademan’s picture

#69 worked fine for me, just put these two lines in ckeditor.config.js on the end of the editorConfig function:

config.fillEmptyBlocks = false;
config.IgnoreEmptyParagraphValue = true;

It will still generate an empty <p></p> though.

pipicom’s picture

Anyone solved this?

jjma’s picture

enterMode:2, forceEnterMode:true, shiftEnterMode:1

This has an effect that you can not use shift and enter to make a line break so you gain by losing the extra

tag but lose the line break?

Update:

My mistake re code. I put in the wrong formatting but I'm now getting
's instead of paragraphs...

Jon

mdecooman’s picture

The following solved the issue for me:

  • Go in admin/config/content/ckeditor
  • Edit the profile you need
  • Go in Advanced Options (at the end)
  • Set to NO the HTML ENTITIES (Helper: Convert all applicable characters to HTML entities.)

PS: using CKEditor Module 7.x-1.12, CKEditor 4.0.1

Maxime

ben833’s picture

Workaround for extra spaces when switching from source to WYSWYG worked for me in Drupal7:

  1. Go to admin/config/content/ckeditor
  2. Edit the Full profile
  3. Go to Cleanup and Output
  4. Enter mode = <br>

Note: this may change the way people interact with the CMS

_paul_meta’s picture

I just installed latest stable versions of drupal's ckeditor module (7.x-1.12) and ckeditor (4.02)

all is fine but for one bug .. first time i create and save a node all is ok. then if i edit it, an extra <p></p> tag is inserted to the html source.

this seems to happen as ckeditor loads. that is to say - when i click edit on a node, the page loads, i can see the correct source code in the text area as html, then ckeditor loads and there is an extra blank line before my content starts, and when i switch to source mode, i see the extra <p></p> .. so it seems the extra tag has been inserted by ckeditor after it loads.

if i save the node then click edit again, there is now two extra empty p tags and so on.

i have tried various combinations of these configs .. to no avail.

config.fillEmptyBlocks = true;
config.IgnoreEmptyParagraphValue = true;
config.autoParagraph = true;

i am not using html purifier, though i did install it and try some of the suggested fixed and its no help.

has anyone else seen this issue? i'm guessing it might be a ckeditor issue but any thoughts appreciated.

I should mention that i am on a mac and have noticed this issue on Firefox, Chrome and Safari. I don't think its a browser issue but it does seem to happen at a javascript level, during the loading of the ckeditor tool.

thanks !

_paul_meta’s picture

Also i should mention - clicking the ckeditor source mode repeatedly does not affect this problem, but toggling the 'Switch to plain text editor" and 'Switch to rich text editor' makes it continually add the extra p tag at the top of the content.

_paul_meta’s picture

i found a solution to the above - it seems that a contrib module was causing some byte order marks to be added to the page's HTML. (described here - http://drupal.org/node/327794)

this became noticeable when i used firebug or chrome inspector to look at the rendered HTML - the head tags were appearing in the body section. This would happen regardless of theme choice. When i isolated and disabled the module causing this (views selective filter) .. the issue with the extra p tag went away. mysterious .. but might be worth noting that if stray markup appears in ckeditor it could be related to byte order marks appearing in your rendered HTML

keiichito’s picture

Hi,

I can confirm this behaviour still occurs.

Core 7.23
CkEditor 7.x-1.13

Any solutions?

Thanks

gabyyy’s picture

I have a similar error with drupal 7.23, CKEditor 7.x-1.13.

Steps to reproduce on clean drupal install:

1 - Install CKEditor 7.x-1.13.
2 - Copy CKEditor library files
3 - Create new content (rich text editor) with 2 paragraphs
4 - Add teaser break after 1st paragraph
5 - Switch to plain text editor
6 - Switch to rich text editor

Result: Each time you switch between plain-text and rich-text editor, <p>&nbsp;</p> is added.

N.B: This bug only happens in IE8, not in Firefox.

bburg’s picture

I get something similar, but with an integration of the Asset module. Asset tokens get wrapped in redundant p elements every time the editor is loaded, via page load, or switching between source view and markup views.

<p></p>
<p></p>
[[asset:image:69057 {"mode":"small","align":"","field_asset_image_copyright":["2014"],"field_asset_image_description":["A description of an image I had laying around from an old project."],"field_asset_image_caption":["This is an image I had laying around from a previous project."]}]]
<p></p>
<p></p>

I don't get the &nbsp; entities because I've set

config.allowedContent = true;
config.fillEmptyBlocks = false;

in my config. (which does prevent these from being noticeable).

ckeditor (module) 7.x-1.13,
ckeditor (library) 4.4.2
asset 7.x-1.0-beta4
drupal 7.25

*Happens in chrome (32.0.1700.77), but not in ff or safari.

MRJWO’s picture

Issue summary: View changes

Hello everyone,

I'm not saying "I figured out the problem here" but I figured out what was wrong with my problem.

I had this issue with any wysiwyg library i tried (TinyMCE and CKEditor) and my paragraphs not spacing properly.

In the end it turned out I had overlooked some sloppy CSS I added which fixed my problem of paragraphs not showing properly I had added the following CSS to my custom theme's style.css file:

p {
padding:0px;
}

Simply deleting this CSS entry solved my problem, give it a shot, I hope it helps!

tajdar’s picture

Empty paragraph killer module worked for me.
Empty paragraph killer

albertski’s picture

Checkout CKEditor Paragraph Paste Fix. This fixes the issue of <p>&nbsp;</p> being added when pasting in content.

mrprasa’s picture

I am using the Wysiwg module with CKEditor (not the CKEditor module), so the CKEditor Paragraph Paste fix was not applicable. A combination of the custom module below to alter the ckeditor configuration and the Emptyparagraph Killer Module worked for me. The Emptypagraph killer didn't work on it's own since CKEditor was inserting an "&nbsp" into the

tags.

<?php

/**
* Implements hook_wysiwyg_editor_settings_alter().
*/
function custom_module_wysiwyg_editor_settings_alter(&$settings, $context) {

if($context['profile']->editor == 'ckeditor') {

$settings['ignoreEmptyParagraph']=false;
$settings['fillEmptyBlocks']=false;
$settings['autoParagraph']=false;
}

}

Summit’s picture

FileSize
959 bytes

Hi,

I made this custom module in a .zip file.
I named it custom_enterwysiwig , thanks for making it Monica!
Greetings, Martijn

ARUN AK’s picture

I think the issue is with CKEditor. It is working fine with CKEditor 3.6.2.7275.

Revathi Manohar’s picture

Hi All,
I am also facing the same issue with the wysiwyg editor.Thank You.

bburg’s picture

Hi Revathi,

Several solutions have been proposed in this thread, give some of those a try.

  1. Upgrade CKEditor to the latest version.
  2. Empty paragraph killer module
  3. CKEditor Paragraph Paste Fix module
  4. Configure CKEditor to remove empty blocks.
  5. Another configuration approach
  6. Change enter mode to use line breaks

I think this issue is a bit nebulous, in that many people are observing the same symptom, which may have multiple causes. Since this issue has been lingering for nearly seven years now, we may consider closing this, or perhaps adding some documentation on best practices for configuring CKEditor.

Revathi Manohar’s picture

Hi bburg,
In my case I have the empty Paragraph tag added at every time when I am editing the content.So the next content which is rendering have the space at the top because of the Paragraph tag in certain content type only.
so what i decide is for this issue

  1. The separate module is not the correct way of approach.
  2. The replacement of Paragraph to Break tag also not the correct way.
  3. We don't want the space in the form of the p tag.

so I referred the comment #92.I followed it.It is great.If we are mistakenly enter enter-key it does not allow the "p" tag.
And it removes the space.

bryancasler’s picture

Status: Active » Closed (outdated)

As the original poster of this issue, I'm glad to see it has gotten so much attention over the last seven years. bburg's comment does a great job of summarizing all the conversation and suggestions collected. And since my original issue was resolved with the release of CKEditor 4, I'm closing this one out!

There are a number of related or similar bugs that have been reported in this thread. Before someone simply re-opens this one, please consider the merits of filing a separate issue that can be more focused on resolving that specific use case.

vchen’s picture

For me the opposite solved the problem.

admin/config/content/ckeditor/

I set this to false under Advanced Options > Custom Javascript configuration:

config.autoParagraph = false;

drupalbabaji’s picture

#99 solved my problem. Thanks vchen

augustoccl’s picture

I know this is outdated, but something really similar to this happened to me and it drove me crazy after a couple of days. I had these mysterious blank lines before the text and I realized that CKEDITOR is adding strange characters at initialization, like '\ufeff' and then converting them to blank lines. My solution was to get rid of them just after initilization:
at sites/all//modules/ckeditor/ckeditor/ckeditor.config.js:
CKEDITOR.on('instanceReady', function (ev) {
ev.editor.setData(ev.editor.getData().replace(/\ufeff.*\ufeff/g,''))
});

This is definitely not a good solution but it was the only thing that solved my problem after trying everything on this thread.

Maybe it will also help someone. Just forgive me for not having a better place to put it, but since this thread is most viewed for people looking for this topic, maybe it will arrive at someone who is gonna bring the final solution. Perhaps it will have something to do with CKEDITOR core, I don't know.

apaderno’s picture

Issue tags: -&nbsp;, -<p> tags

I am removing issue tags used from one to four issues. I apologize for bumping the issue.