Opened 4 years ago

Last modified 22 months ago

#10553 confirmed Bug

Find and Replace dialog cannot match text with multiple spaces

Reported by: Zoltan Koszegi Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1.1
Keywords: oracle IBM Cc: satya_minnekanti@…


Steps To Recreate (tested with IE9 on Demo page):

1) Include multiple spaces between words.

2) Click the 'Replace' tool.

3) Choose to replace " " with " " (or just find any number of spaces > 1).

RESULT: You can not find/replace 2 or more spaces.

This is probably because multiple spaces in html are represented as nbsp entities or binary nbsp characters plus a single space character, and probably CK doesn't handle that.

Attachments (1)

ckeditor_nbsp_chrome.png (63.3 KB) - added by Joel 4 years ago.
Screenshot of chrome showing nbsp entity issue in demo

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by Zoltan Koszegi

Keywords: oracle added
Version: 4.1.1

comment:2 Changed 4 years ago by Jakub Ś

Status: newconfirmed

Problem can be reproduced from CKEditor 3.0 in both CKE 3.x and 4.x.

comment:3 Changed 4 years ago by Joel

Another (similar) TC: the nbsp replacement sometimes goes a little wrong. Might be rare and/or impossible to fix but at least people coming from Google might find interesting: accidental double spaces can cause the content searchability to fail. To duplicate in IE9 or Chrome:

  1. Go to
  2. Clear the editor
  3. Write "ponies rule" (with two spaces between the words)

CKEDITOR.instances.editor1.getData(); now returns "<p>ponies&nbsp; rule</p>".

  1. Move caret to "ponies |rule" (caret after the two spaces)
  2. Hit backspace to remove the 'accidental' double space

CKEDITOR.instances.editor1.getData(); now returns "<p>ponies&nbsp;rule</p>".

After step 5 the search function can't find "ponies rule". Happens even when entitites = false; in the config. Weather the first or second space gets entityfied seems to depend on the browser or luck.

comment:4 Changed 4 years ago by Jakub Ś

I have tested this and Chrome in fact return "<p>ponies &nbsp;rule</p>" which after removing one space gets changed to "<p>ponies rule</p>". The first text with entity can't be found while second can.
This " &nbsp;" is controlled by browser and we can do nothing here but I believe editor should be able to search for entities to.

In IE this looks a little bit different. The "<p>ponies&nbsp; rule</p>" is created and search success fail depends on which space you remove (unlike in Chrome where always entity is removed). Anyway result is the same - of you have text with entity, it won't be found.

Changed 4 years ago by Joel

Attachment: ckeditor_nbsp_chrome.png added

Screenshot of chrome showing nbsp entity issue in demo

comment:5 Changed 4 years ago by Joel

In Chrome, did you backspace the " " or the "nbsp"? Because for chrome for me actually does happen, see attached screenshot. Chrome Version "28.0.1500.72 m" on Windows 7 64bit. So in Chrome the TC is a little different, in step 4 the issue is duplicated by moving caret to "ponies | rule" and pressing backspace or "ponies| rule" and pressing delete.

I can't put the image directly here because Akismet tells me it's spam - derp!

Last edited 4 years ago by Joel (previous) (diff)

comment:6 Changed 4 years ago by Zoltan Koszegi

We use CK editor in IE browser control. Everything I reported just tried with IE.

comment:7 Changed 4 years ago by Irina

The bug with Find can also be reproduced in FF:


  1. Type in A B(with 2/3 spaces between the letters)
  2. Open Find dialog and search for A B(with 2/3 spaces between the letters)

Result: Text was not found

comment:8 Changed 4 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added
Keywords: IBM added


comment:9 Changed 3 years ago by Artur Delura

It's a browser independent bug, and easiest use case is:

  1. Open editor with following content: "<p>hello&nbsp;world</p>"
  2. Open "Find" dialog box by clicking appropiate button on toolbar
  3. Try to find sentence "hello world"

Actual result: Nothing found but should one

comment:10 Changed 22 months ago by Anna Tomanek

Summary: CANNOT FIND/REPLACE MULTIPLE SPACESFind and Replace dialog cannot match text with multiple spaces
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy