Opened 9 years ago

Closed 7 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 &nbsp;&nbsp;</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&nbsp;</p>\n"

Is this a known issue? I was unable to find anyone else who reported this behaviour.

Thanks.

Attachments (1)

6925.patch (2.9 KB) - added by Garry Yao 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by Hussam

BTW, this behavior was seen on IE 8 and Firefox 3.6 on Windows 7 Professional.

Changed 9 years ago by Garry Yao

Attachment: 6925.patch added

comment:2 Changed 9 years ago by Garry Yao

Component: GeneralCore : Output Data
Keywords: space getData removed
Status: newconfirmed

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 &nbsp;&nbsp;</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 9 years ago by Garry Yao

Owner: set to Garry Yao
Status: confirmedreview

Patch tackles the secondary case, where editor output trims desired spaces that was created by user (in wysiwyg).

comment:4 Changed 7 years ago by Jakub Ś

Resolution: fixed
Status: reviewclosed

I was not able to reproduce this problem neither in CKE 3.x nor 4.x

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy