Opened 9 years ago
Closed 7 years ago
#14256 closed Bug (fixed)
Range -> extractContents -> unexpected result
Reported by: | Alexander | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Selection | Version: | 4.5.4 |
Keywords: | Support | Cc: |
Description (last modified by )
Steps to reproduce
- Open CKEditor demo page - http://ckeditor.com/demo
- Select any text
- Open "dev tools"(F12) -> console
- Try to execute next code
currentRange = CKEDITOR.instances.editor1.getSelection().getRanges()[0]; clonedHTML = range.cloneContents().getHtml(); extractedHTML = range.extractContents().getHtml();
Expected result
clonedHTML and extractedHTML must be equal
Actual result
clonedHTML and extractedHTML are different
Other details (browser, OS, CKEditor version, installed plugins)
Reproducible in every browser starting from CKeditor 4.5.0
Change History (7)
comment:1 Changed 9 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 9 years ago by
Probably that problem is caused by bug in extractContents
implementation, described in my comment for #13842 issue.
comment:4 Changed 7 years ago by
#17033 was marked as duplicate.
TC from that ticket:
- Put attached sample into
ckeditor/samples
folder and open it - Apply same styles and selections as in attached video:
This is some [sample text.]
- apply yellow markerThis is [some sample text.]
- apply underline[This is some sample text.]
- pressPrint Extract Contents
button
Expected result
This is <u>some <span class="marker"><strong>sample text</strong>.</span></u>
comment:5 Changed 7 years ago by
Keywords: | Support added |
---|
comment:6 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:7 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
Running this code in a console:
there are some cases for which html differs - when part of the list or table is selected or source footer, e.g:
clonedHTML:
<p>had three parts:</p><ol><li><strong>Command Module</strong> with a ca</li></ol>
extractedHTML:
<p>had three parts:</p><ol><li> with a ca<strong>Command Module</strong></li></ol>