Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#71 closed Bug (fixed)

Block elements can't contain child block elements

Reported by: Frederico Caldeira Knabben 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 (4)

comment:1 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.5

comment:2 Changed 17 years ago by Frederico Caldeira Knabben

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

comment:3 Changed 17 years ago by Sean

Great, I like the tag <blockquote>

comment:4 Changed 17 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

Fixed with [308].

Click here for more info about our SVN system.

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