Editor adds extra "<p>&nbsp;</p>" tag at end of code

Joshua Martin - January 26, 2008 - 22:55
Project:FCKeditor - WYSIWYG HTML editor
Version:5.x-2.0-beta
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:duplicate
Description

Using module 5.x-2.0-beta and FCK 2.5 as instructed -

The CORRECT source code looks like this -

text here

but every time I switch to source view, FCK adds an unwanted P tag at the end -

text here

 

could somebody explain why FCK is adding the extra p tag at the end?

or even better - how can I fix so my code will not get damaged?

and please do not suggest changing FCKConfig.EnterMode to 'br' ... obviously hitting the ENTER key should create a PARAGRAPH, but SWITCHING TO SOURCE VIEW should NOT create empty paragraphs

this is urgent, in the sense that Drupal needs a stable WYSIWYG editor which does not damage source code

#1

Joshua Martin - January 26, 2008 - 22:57

CORRECT SOURCE CODE:

<div>text here</div>

INCORRECT AFTER SWITCH TO SOURCE VIEW:

<div>text here</div><p>&nbsp;</p>

as above

#2

wwalc - January 28, 2008 - 13:54
Status:active» active (needs more info)

What browser and which version of FCKeditor (the editor, not the FCKeditor module) are you using?
FCKConfig.EnterMode is set to <p>?

#3

LouBabe - January 29, 2008 - 20:40

I'm seeing the same behavior using FF 2.0.0.11 on a Mac. Enter mode is set to

. Using the latest version of FCKEditor, 2.5 I believe.

#4

bsuttis - March 6, 2008 - 07:53

I've got the same problem, each of my FCKeditor textareas outputs an additional <p>&nbsp;</p>

Version 2.5.1 of FCKeditor

Additionally, I seem to get this when ending a textarea with a OL or UL, but if I end it with a P, it doesn't happen.

#5

jeffsensat - March 22, 2008 - 03:25

I’m seeing the same exact behavior with Drupal 6.1, FCKEditor module 6.x-1.1, FCKEditor 2.5.1 on Firefox 2.0.0.12 and 3.0b4.

#6

jeffsensat - March 22, 2008 - 18:27

I upgraded to FCKEditor 2.6 Beta. That fixed the extraneous insertion of &nbsp;, <p></p> and <div></div> code (using Drupal 6.1 and FCKEditor module 6.x-1.1).

#7

mjos - April 15, 2008 - 21:29

Hi,

I just ran into the same problem with FCKeditor 2.6 on Drupal 6.2. This was due to the default setting of FCKEditor configuration options. Use these settings in your FCKEditor profile:

FCKConfig.IgnoreEmptyParagraphValue = true ;
FCKConfig.FillEmptyBlocks = false ;

#8

dougzilla - April 27, 2008 - 21:14

I looked for this setting in drupal 5.7 and did not see it. Is this a drupal 6 thing?

#9

ktothev - April 30, 2008 - 04:21

These settings are in fckeditor/fckeditor/fckconfig.js (using 5.x-2.1)

However if I change them as suggested above:
FCKConfig.IgnoreEmptyParagraphValue = true ;
FCKConfig.FillEmptyBlocks = false ;

It still adds an extra <p> however doesn't put &nbsp; inside it. So it just looks like this: <p></p>.

Has anyone found a solution?

#10

activelyOUT - May 9, 2008 - 16:28

subscribing

#11

rssole - May 14, 2008 - 08:51

I've had same problem, after inspection it turned out that problem was in my file-saving code, I can suggest you to do the same thing if nothing else solved your problem.

If you are saving content from fck into file, truncate file (to clear current content) then save content from fck to file. That solved problem for me.

Good luck!

#12

okeedoak - May 19, 2008 - 00:32

I'm seeing the same thing but not consistently.

#13

Mattias-J - May 20, 2008 - 11:37

subscribing

#14

okeedoak - May 21, 2008 - 03:26
Status:active (needs more info)» duplicate

This is a duplicate of http://drupal.org/node/241271 which seems more authoritative.

 
 

Drupal is a registered trademark of Dries Buytaert.