Opened 9 years ago

Last modified 9 years ago

#12673 confirmed Bug

Pasting a single whitespace besides an existing one in firefox has no effect

Reported by: Lukas Felber Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: IBM Firefox Cc:


Copying a single whitespace and the pasting it several times again has not effect.

  • Steps to reproduce:
  1. Open a ckeditor text field and put
    x x

into it.

  1. Copy the whitespace (without the 'x')
  2. Paste the whitespace 5 times
  • Actual output:

1 whitespaces

  • Expected output:

1 whitespaces

  • Additional information:

Copying single whitespace in Chrome and Internet Explorer works fine. In firefox it also works if one copies 2 or more whitespaces.

Reproducing this but work also while using double byte whitespace instead of single byte whitespace.

Change History (3)

comment:1 Changed 9 years ago by Jakub Ś

What you see is how brwosers nativly handle white space pasted repeatedly.

Firexox doesn't allow it from what I can see (checked in native contenteditable) while all other browsers change spaces into  

comment:2 Changed 9 years ago by Jakub Ś

Keywords: Firefox added
Status: newconfirmed
Version: 3.0

We have decided to confirm this issue. In CKEditor 4.5 we plan to introduce our own selection which is supposed to fix many browser differences - perhaps our selection will also include this one.

comment:3 Changed 9 years ago by Piotrek Koszuliński

Unfortunately I checked that there's also an issue in the editor.insertHtml method, or at least it looks like, because subsequent editor.insertHtml( ' ' ) calls behave the same way as pasting.

The problem here is pretty complex, because inserting one space after another should replace the previous space with an nbps, inserting a space after nbsp should insert a normal space and between nbsps it should insert an nbsp. When pasting multiple spaces this becomes even more interesting. Furthermore, this must work differently at blocks boundaries...

Anyway, the simple workaround could be to replace a space with an nbsp when only space is inserted. Then, in some cases it would lead to inserting too many nbsp, but at least pasting would work. On the second hand, pasting space after space is an edge case and nbsps in the editor are harmful for the content (because lines start to wrap in weird places). Thus, I wouldn't accept such patch for the editor, because current behaviour causes less problems.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy