Project:CKEditor - WYSIWYG HTML editor
Version:7.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:newcitypro
Status:needs work
Issue tags:&nbsp;, <p> tags

Issue Summary

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

Comments

#1

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.

#2

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.

#3

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.

#4

Status:active» fixed

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

#5

Status:fixed» closed (fixed)

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

#6

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

#7

Status:closed (fixed)» active

#8

Status:active» closed (fixed)

The solution was given.

#9

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,

#10

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.

#11

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

#12

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.

#13

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?

#14

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?

#15

Hi,

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

Any solutions?

Thanks

#16

Status:closed (fixed)» active

#17

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.

#18

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.

#19

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.

#20

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.

#21

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.

#22

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

#23

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

#24

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.

#25

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.

#26

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

#27

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.

#28

subscribe

#29

Version:6.x-1.1» 6.x-1.2
Assigned to:Anonymous» 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?

#30

Same issue here... subscribing.

#31

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

#32

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.

#33

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.

#34

subscribing..,

#35

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)

#36

subscribing

#37

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

#38

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.

#39

sub

#40

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

#41

@mpoplin where did you add the line?

#42

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

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

Just a temporary solution :)

#43

Version:6.x-1.2» 6.x-1.8
Status:closed (cannot reproduce)» closed (works as designed)

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}

AttachmentSize
Filter_Settings.PNG 41.83 KB
Text_Processing.PNG 3.36 KB

#44

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

#45

#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.

#46

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

#47

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

#48

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.

#49

Is there somewhere we can report this to CKeditor folks?

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

#50

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.

#51

@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

#52

Cross referencing this from the WYSIWYG module #550428: Tags like <p>&nbsp;</p> or <br /> added to empty textareas

#53

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

#54

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

#55

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....

#56

@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.

#57

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.

#58

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.

#59

lalit774, what's that about chrome?

#60

hi dear,

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

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

#61

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.

#62

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';
  }
}

#63

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

#64

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)

#65

#62 works for me!
Thanks!

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

#66

Same problem apparently in D6. Please backport when solved

nobody click here