Opened 9 years ago

Closed 9 years ago

#14255 closed Bug (worksforme)

Insert html does not work

Reported by: newdegate Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.1
Keywords: Cc:

Description

Steps to reproduce

  1. d=CKEDITOR.instances.id_body
  2. d.insertHtml('<p class=\x22text-uppercase\x22>test</p>')
  3. CKEDITOR.instances.id_body.getData();

Expected result

<p class=text-uppercase>test</p>

Actual result

<p>test</p>

Other details (browser, OS, CKEditor version, installed plugins)

Change History (3)

comment:1 Changed 9 years ago by newdegate

Please also note - the ckeditor version = 4.5.1

comment:2 Changed 9 years ago by newdegate

Please ignore the above - the solution which now works is:

var v=CKEDITOR.instances.id_body.getSelectedHtml() var d=CKEDITOR.instances.id_body

var html = "<span class='text-capitalize' style='text-transform:capitalize'>" + text + "</span>";

var newElement = CKEDITOR.dom.element.createFromHtml( html, d.document ); d.insertElement( newElement );

comment:3 Changed 9 years ago by newdegate

Resolution: worksforme
Status: newclosed
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