Opened 14 years ago
Closed 12 years ago
#6925 closed Bug (fixed)
Leading and trailing spaces are not included in getData
Reported by: | Hussam | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | 3.5 |
Keywords: | Cc: |
Description
I'm using the latest CKEditor version 3.5 and it seems that leading and trailing spaces are not being correctly reported using the getData() API. Here are the details:
If spaces are entered before or after any character, or only spaces are entered, not all spaces are reported in the data returned by the getData() call. Here is an example: Type a single space ==> getData() returns an empty string "" Type another space ==> getData() still returns an empty string "" Type a 3rd space ==> getData() now returns this string "<p>\n </p>\n"
Also a trailing space that follows any character is not reported. Example: Enter any letter (e.g: w) ==> getData() returns "<p>\n w</p>\n" Now enter a space ==> getData() still returns "<p>\n w</p>\n" Enter another space ==> getData() now returns "<p>\n w </p>\n"
Is this a known issue? I was unable to find anyone else who reported this behaviour.
Thanks.
Attachments (1)
Change History (5)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | 6925.patch added |
---|
comment:2 Changed 14 years ago by
Component: | General → Core : Output Data |
---|---|
Keywords: | space getData removed |
Status: | new → confirmed |
Here is an example: Type a single space ==> getData() returns an empty string "" Type another space ==> getData() still returns an empty string "" Type a 3rd space ==> getData() now returns this string "<p>\n </p>\n"
AFAIK it's not a bug, the editor has an ignoreEmptyParagraph configuration option that ignores any "blank" paragraph, we can work it around by allow paragraph with one single space.
comment:3 Changed 14 years ago by
Owner: | set to Garry Yao |
---|---|
Status: | confirmed → review |
Patch tackles the secondary case, where editor output trims desired spaces that was created by user (in wysiwyg).
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
I was not able to reproduce this problem neither in CKE 3.x nor 4.x
BTW, this behavior was seen on IE 8 and Firefox 3.6 on Windows 7 Professional.