Opened 9 years ago
Last modified 9 years ago
#14634 confirmed Bug
getSelectedText omits <br> characters in IE
Reported by: | RHabib | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.6.1 |
Keywords: | IE | Cc: |
Description
Steps to reproduce
- Enter following text in CKEditor in IE 11
line 1
line 2
line 3
- select text and In JS call
CKEDITOR.instances[yourid].getSelection().getSelectedText()
- The returned text is "line 1line 2line 3"
- The length of string is 18. While in chrome it is 21
Expected result
The returned text should have \n characters
Actual result
The returned text is "line 1line 2line 3" The length of string is 18. While in chrome it is 21
Other details (browser, OS, CKEditor version, installed plugins)
Chrome:
The returned text is "line 1\nline 2\nline 3"
IE11:
The returned text is "line 1line 2line 3"
Change History (1)
comment:1 Changed 9 years ago by
Keywords: | IE added |
---|---|
Status: | new → confirmed |
Version: | 4.4.7 → 3.6.1 |
Problem can be reproduced in IE browsers from CKEditor 3.6.1 (when
getSelectedText
was introduced).This method uses native selection methods and in IE something like below is executed:
This can be simplified to:
It looks like the native
toString()
method for nativeselection
returns text without line breaks.This will require some research but from what I have checked for this test case a much better would be using
focusNode.innerText
which returns text with line breaks.