Opened 11 years ago
Last modified 10 years ago
#11636 closed New Feature
Improve selection.getSelectedHTML, range.cloneContents and range.deleteContents — at Initial Version
Reported by: | Piotr Jasiun | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.5.0 Beta |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Because of custom implementation of drag & drop (#11460) we will use selection.getSelectedHTML
and range.deleteContents
more often to read and remove dragged HTML. Current implementation of selection.getSelectedHTML
can not be based on range.cloneContents
because it changes range (#11586) and works not as we could expected.
For this reasons we need to reimplement selection.getSelectedHTML
, range.cloneContents
and range.deleteContents
.
range.cloneContents
and range.deleteContents
should behave more as user could expect than simple clone or delete. For example:
- for '
xx<a href="foo">b[a]r</a>xx
'range.cloneContents
should return '<a href="foo">a</a>
', - for '
<p>[foo]</p>
'range.deleteContents
' should remove whole paragraph, - for '
<table><tr>[<td>foo</td><td>b]ar</td></tr></table>
'range.deleteContents
should change contents to the '<table><tr><td></td><td>ar</td></tr></table>
'.
selection.getSelectedHTML
should be based on range.cloneContents
.