Opened 14 years ago

Last modified 14 years ago

#6496 closed Bug

Replacing multiple paragraphs with an element does not fully remove the paragraphs — at Initial Version

Reported by: Joe Kavanagh Owned by:
Priority: Normal Milestone:
Component: General Version: 3.5
Keywords: IBM Cc: Damian Lynne Kues

Description

  1. Open the Ajax sample.
  1. Create four paragraphs, for example:
<p>  paragraph one</p>
<p>  paragraph two</p>
<p>  paragraph three</p>
<p>  paragraph four</p> 
  1. Select the two middle paragraphs.
  1. Execute the following code
var anchor = editor.document.createElement('a');
anchor.setAttribute('href', 'http://dev.ckeditor.com');
anchor.setHtml('dev.ckeditor.com');
editor.insertElement(anchor);

Observe that the contents of the selected paragraphs have been removed, but the empty tags remain:

<p>paragraph one</p>
<p>&nbsp;</p>
<p><a href="http://dev.ckeditor.com">dev.ckeditor.com</a></p>
<p>&nbsp;</p>
<p>paragraph four</p> 

The selection should be fully replaced as expected.

Change History (0)

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