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
- Open the Ajax sample.
- Create four paragraphs, for example:
<p> paragraph one</p> <p> paragraph two</p> <p> paragraph three</p> <p> paragraph four</p>
- Select the two middle paragraphs.
- 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> </p> <p><a href="http://dev.ckeditor.com">dev.ckeditor.com</a></p> <p> </p> <p>paragraph four</p>
The selection should be fully replaced as expected.