Ticket #546 (closed Bug: invalid)

Opened 7 years ago

Last modified 7 years ago

The editor creates   inside p after an enter key

Reported by: leelouch Owned by:
Priority: Normal Milestone:
Component: UI : Enter Key Version: SVN (FCKeditor) - Retired
Keywords: Cc:

Description

juste type Enter key, and then click on the source button, you will have <p>&nbsp;</p> or <p>&#160;</p> depending on ProcessHTMLEntities var which is not normal I think ! related bugs are 243 267 and 71 :

Change History

comment:1 Changed 7 years ago by alfonsoml

  • Keywords Pending added
  • Milestone FCKeditor 2.5 deleted
  • Summary changed from The editor still create invalid nested block elements, like creating &lt;form&gt; or &lt;hr&gt; inside &lt;p&gt;. &nbsp; after a enter key to The editor still create invalid nested block elements, like creating form or hr inside p after a enter key

Please, provide detailed steps to reproduce, including the browser that you're using. It seems to work fine for me in the trunk.

comment:2 Changed 7 years ago by leelouch

Path: . URL: http://svn.fckeditor.net/FCKeditor/trunk Repository Root: http://svn.fckeditor.net Repository UUID: da63caf2-3823-0410-a1e8-d69ccee00dfb Revision: 365 Node Kind: directory Schedule: normal Last Changed Author: alfonsoml Last Changed Rev: 365 Last Changed Date: 2007-06-09 12:15:26 +0200 (Sat, 09 Jun 2007)

firefox 2.0.0.4 / explorer 7.5730.11 under WinXP or firefox 2.0.0.4 under linux centos-3 to reproduce type in _samples\default.html: (editor with all features) """ hello world

bingo

"""

then toggle to source code:

""" <p>hello world</p> <p>&nbsp;</p> <p>&nbsp;bingo</p> <p>&nbsp;</p> """

comment:3 Changed 7 years ago by alfonsoml

I don't see any form or hr there. Could you explain better what's the problem?

comment:4 Changed 7 years ago by leelouch

the problem for me is the "&nbsp;" or "&#160" insertion between <p></p> ! while a simple space character that can be inserted instead. is it normal to have the &nbsp; instead off a space character ? if not than ok but it's weerd. this cause some problems when decoding html into wiki websites ...

Note: Oh by the way sorry for the tittle . forgate the "form or hr inside p after a enter key" part, I wasin't able to change the title after creation the bug !

comment:5 Changed 7 years ago by alfonsoml

  • Keywords Pending removed
  • Status changed from new to closed
  • Resolution set to invalid
  • Summary changed from The editor still create invalid nested block elements, like creating form or hr inside p after a enter key to The editor creates &nbsp; inside p after an enter key

That's the proper behavior to make browsers happy.

You can set

FCKConfig.FillEmptyBlocks	= false ;

then it might not be easy to put the cursor inside those empty elements, but you won't get the &nbsp;s

comment:6 follow-up: ↓ 8 Changed 7 years ago by leelouch

Ok fine, but I have two notes:

  1. why puting a &nbsp; instead of " " (a simple white space characters)
  2. even with FCKConfig.FillEmptyBlocks = false ; it's better but not perfect :

type "hello" followed by Enter, then "toto" followed by Enter, then a Space, then toggle to source. a &nbsp; will appear. """ hello

toto

""" --> """ <p>hello<br /> coucou<br /> &nbsp;</p> """ NB: if you think that this area is not the right place to have this discussion please let me know Thanks

comment:7 Changed 7 years ago by fredck

The reason for adding &nbsp; is quite simple. Just create two html pages. In one of them, place the following code:

<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Last P</p>

In the other, try with the &nbsp;:

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Last P</p>

Open both pages... the difference is obvious.

If for some reason you really don't want them, it is not a big issue to replace all &nbsp; occurrences with a simple space, right?

comment:8 in reply to: ↑ 6 Changed 7 years ago by fredck

Replying to leelouch:

Ok fine, but I have two notes:

  1. why puting a &nbsp; instead of " " (a simple white space characters)
  2. even with FCKConfig.FillEmptyBlocks = false ; it's better but not perfect :

type "hello" followed by Enter, then "toto" followed by Enter, then a Space, then toggle to source. a &nbsp; will appear.

There would be no ways to represent the space that "you have typed" otherwise. Spaces in HTML has no value other than separating characters or objects.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy