Opened 7 years ago

Closed 7 years ago

#9375 closed Bug (fixed)

target.insertHtml is not working properly

Reported by: yveszx Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0 Beta
Keywords: Cc:

Description

when you use target.insertHtml("somehtml"); the editor will remember what was inserted earlier and will load it again !

how to replicate :

insert an image in a blank document, select all and delete (Blank page now) then use a custom plugin that inserts some html

    final_html = '<a class="glossary"  href="glossary.aspx" target="_blank"> link </a>';
    target.focus();
    target.insertHtml(final_html);

And the image will be back...

The trace goes on, if you insert an image, then table and delete all and run the code above you will get everything back !

Change History (3)

comment:1 Changed 7 years ago by Jakub Ś

Status: newpending

I think there is something clearly wrong with your plugin or the problem has expired on trunk. I have tried similar TC and nothing like that happened.

  1. I have opened latest nightly replacebycode sample - http://nightly-v4.ckeditor.com/
  2. Cleared editor contents
  3. Entered and executed in firebug console:
    CKEDITOR.instances.editor1.insertHtml('<img alt="" src="http://a.cksource.com/c/1/inc/img/demo-little-red.jpg" style="width: 120px; height: 168px;" />');
    
  4. I have cleared the page
  5. Entered and executed in firebug console (tried with focus left in editor and not):
        CKEDITOR.instances.editor1.focus();
        CKEDITOR.instances.editor1.insertHtml('<a class="glossary"  href="glossary.aspx" target="_blank"> link </a>');
    

@yveszx could you try the above TC or your plugin with latest nightly (http://nightly-v4.ckeditor.com/) or master version (https://github.com/ckeditor/ckeditor-dev.git) and see if problem still occurs?

Waiting for your comments.

comment:2 Changed 7 years ago by yveszx

Downloaded the nightly build and everything seems to be working fine !

I will continue testing using the nightly build.

Yves

comment:3 Changed 7 years ago by yveszx

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