Ticket #71 (closed Bug: fixed)

Opened 21 months ago

Last modified 16 months ago

Block elements can't contain child block elements

Reported by: FredCK Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version:
Keywords: Cc:

Description

We must completely avoid creating block elements inside block elements. Other than being non standards compliant, it causes the code to be broken on both IE and Firefox.

The most obvious case is the <form> creation. Just try these steps in IE:

  1. Open sample01.html
  2. Hit [Enter] At the end of the fisrt line.
  3. Insert a form with the relative toolbar button.
  4. Place the cursor inside the form.
  5. Type some text and hit enter.
  6. Type more text.
  7. Switch to source view... the second <p> was moved to the end of the HTML.
  8. Switch back to WYSIWYG, and back to Source... everything has been moved out of the form.

Similar problems happen with the <hr>. So we must provide a way to break the current block when inserting new block elements. This code has been developed for the FCKEnterKey, so we could use that.

Maybe it is a good idea to change FCK.InsertElement to automatically do that job based on the input element type (block / inline).

It is important to leave to the user to move out from the new created block. For example, if we are inserting a form, we must be sure the user will be able to move after the form (another element must be there to get the cursor focus). This is most difficult when EnterMode=br... maybe a &nbsp; is enough in that case.

Change History

Changed 21 months ago by FredCK

  • milestone set to FCKeditor 2.5

Changed 21 months ago by FredCK

<blockquote> must also be handled accordingly (today we use the indentation to produce include them).

Changed 20 months ago by Sean

Great, I like the tag <blockquote>

Changed 17 months ago by fredck

  • status changed from new to closed
  • resolution set to fixed

Fixed with [308].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.