Opened 9 years ago

Closed 9 years ago

#13865 closed Bug (invalid)

[Chrome] Copy - Paste adds non-breaking space

Reported by: Maxime Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Hi, The problem is that a non-breaking space is replaced by empty char after saving changes in CKEditor, and so the text before and after the space is joined.

Steps to reproduce

  1. Go on http://ckeditor.com/demo
  2. Copy some text from the CKEditor frame
  3. Press ENTER
  4. Type some text and press SPACE
  5. Press Ctrl+V / Cmd+V (depending on your Operating System)
  6. In the Web Dev Tools, in the source, you'll see "Your text Your pasted text"

Expected result

"My text my pasted text"

Actual result

"My text my pasted text"

Other details (browser, OS, CKEditor version, installed plugins)

Reproduce on CKEditor 4.4.7, 4.5.4 Ubuntu 15.04, Windows XP, Windows 7 Chrome v46.0.2490.80 (Ubuntu 15.04)

Change History (2)

comment:1 Changed 9 years ago by Maxime

Keywords: Webkit Chrome Space added

comment:2 Changed 9 years ago by Jakub Ś

Keywords: Webkit Chrome Space removed
Resolution: invalid
Status: newclosed
Version: 4.5.4

This is how Chrome handles it and there is nothing we can do about it currently. Please try below:

  1. Use this code:
    <div style="border:1px solid black; width:500px; height:50px;" contenteditable="true">
    	pasted
    </div>
    
  2. Select text and use Ctrl+X
  3. Press Backspace few times
  4. Type "Your text "
  5. Paste cut text.

Result: Your text&nbsp;pasted

This is how how Chrome handles it and the only thing I can recommend is that you change &nbsp; to ' ' on server side once CKEditor content is submitted.

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