Opened 17 years ago

Last modified 13 years ago

#1415 confirmed Bug

empty div tags are removed

Reported by: Alfonso Martínez de Lizarrondo Owned by:
Priority: Normal Milestone:
Component: Core : Parser Version: 3.0
Keywords: Discussion Cc:

Description

switch to source and paste

<div id="black_box"></div> 

switch twice and you'll see that the content has been lost.

(any browser)

Reported in http://www.fckeditor.net/forums/viewtopic.php?f=6&t=7251

Change History (3)

comment:1 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Discussion added
Priority: HighNormal

It doesn't happen if we have more content, like:

<div id="black_box"></div>
<p>Test</p>

It is much probably is related to the cleanup we do to avoid having <p></p> or <div></div> tags, retrieving empty content to indicate that the editor has been left empty.

Suppose a user starts typing inside a <div>, and then delete everything with backspace. People claimed to have the editor posting empty, instead of <div></div>. But the ticket comes with another user case, where the editor is used to place an empty container.

What is the desired behavior here, to be able to handle all user cases?

comment:2 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Some quick ideas:

  • always, if the editor is in source mode, no clean up should be done (I think that it's the current behavior)
  • If the content is the same that the initial text, then assume that it is right and it shouldn't be cleaned
  • probably a single empty <p> or <br> (with nothing else) could always be cleaned
  • if the content is a div and enter mode!= div then don't clean it
  • if it has some attribute like class or id, then it probably shouldn't be cleaned

comment:3 Changed 13 years ago by Krzysztof Studnik

Component: GeneralCore : Parser
Status: newconfirmed
Version: FCKeditor 2.4.33.0

Actual also for CKE3.6.2Trunk

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy