Opened 11 years ago

Closed 6 years ago

#2526 closed Bug (worksforme)

InsertHTML Problem

Reported by: Shaun Owned by:
Priority: Normal Milestone:
Component: Core : Output Data Version: FCKeditor 2.6.3 Beta
Keywords: Cc: COURTNEYREMES@…

Description

This occurs when I try to use the InsertHtml method.

  1. Enter the source view.
  2. Completely clear all HTML in the editor.
  3. Go back to WYSIWYG view.
  4. Click a button which calls the following code:
    content.InsertHtml('<table cellspacing="0" cellpadding="0" border="0" width="100%">'
     + '<tbody>'
     + '<tr valign="top">'
     + '<td>&nbsp;</td>'
     + '<td width="210">&nbsp;</td>'
     + '</tr>'
     + '</tbody>'
     + '</table>'
    );
    

It inserts it as I expect it to, except it wraps the table in <p></p> tags.

If I try to insert the table into an existing paragraph tag, then it works as expected. I assume this is because there is already a paragraph tag wrapped around it.

I'm not familiar with modifying FCKEditor, or I'd attempt to provide a solution.

My only guess as to a fix is that the editor should determine if the html being inserted is a block-level element or not. If it isn't, then wrap in <p></p> tags.

Change History (4)

comment:1 Changed 11 years ago by Artur Formella

Keywords: Confirmed added
Version: FCKeditor 2.6.3FCKeditor 2.6.3 Beta

In 2.6.2 there is <p>&nbsp;</p> before inserted code.

In 2.6.3 Beta code is wrapped in <p></p> (oFCKeditor.Config[ "EnterMode" ]= "p" ;)

comment:2 Changed 10 years ago by relish27

Cc: COURTNEYREMES@… added

comment:3 Changed 10 years ago by Artur Formella

Component: GeneralCore : Output Data

Similar ticket #2781. Probably due to the same reason.

comment:4 Changed 6 years ago by Frederico Caldeira Knabben

Resolution: worksforme
Status: confirmedclosed

This is not any more an issue with CKEditor 4.

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