Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#8232 closed Bug (fixed)

Inline styles create empty garbage "cke_bm_" spans

Reported by: Sheezwack Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.2
Component: Core : Styles Version: 3.6.1
Keywords: Cc:


This happens in IE9/Windows 7 at least (other versions not yet tested). It does not happen in FF4/Windows 7.

Problem exists in the current nightly build and 3.6.1 at least.

Steps to reproduce:

  1. Open the demo page (
  2. Highlight the " about" text next to the "fairy tale" link USING THE MOUSE. Make sure the space before "about" is also selected.
  3. Change the text color
  4. The text color does not change, and empty hidden spans <span id="cke_bm_104S" style="display: none;">&nbsp;</span> are added


  • This happens with text or background color (possibly other operations as well)
  • Strangely it doesn't happen when you highlight " about" with the keyboard, holding shift to highlight.
  • I have noticed that empty hidden spans are added in other cases as well, but again it only happens with mouse selection, not if you select with the keyboard.

Attachments (1)

8232.patch (427 bytes) - added by garry.yao 6 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by j.swiderski

  • Keywords IE9 added
  • Status changed from new to confirmed
  • Version changed from 3.6.1 to 3.2.1
  1. Open replace by code sample and paste in the following code:
    	This is some <strong>sample text</strong>. You are using <a href="">CKEditor</a>&nbsp;test version.</p>
  2. Select word test with a space before
  3. Applay text-color or backgrond-color (Only those two cases are affected)


	This is some <strong>sample text</strong>. You are using <a href="">CKEditor<span id="cke_bm_267S" style="display: none;">&nbsp;</span><span style="display: none;">&nbsp;</span></a>&nbsp;test<span style="display: none;">&nbsp;</span><span id="cke_bm_267E" style="display: none;">&nbsp;</span> version.</p>

Issue has been reproducible in IE9 from CKE 3.2.1

comment:2 Changed 6 years ago by fastballweb

  • Keywords Firefox inline styles added
  • Summary changed from [IE9] Text color issue & empty span issue to Inline styles create empty garbage "cke_bm_" spans
  • Version changed from 3.2.1 to 3.6.1

I'm having this same issue, but with some key differences:

  • I can reproduce it in IE9, Firefox, and Safari
  • Keyboard or mouse selection makes no difference

In my case I'm trying to use custom defined styles. To reproduce:

  1. Visit my instance of CKeditor 3.6.1 at
  2. Paste in the following source:
	Test Item 1</h3>
<div class="unfold_body unfold_hidden">
		Test Text 1</p>
<!-- .unfold_body -->
	Test Item 2</h3>
<div class="unfold_body unfold_hidden">
		Test Text 2</p>
<!-- .unfold_body -->
	Test Item 3</h3>
<div class="unfold_body unfold_hidden">
		Test Text 3</p>
<!-- .unfold_body -->
  1. Select first H3 item (Test Item 1)
  2. Apply "Unfolder Span" style from Styles dropdown (works)
  3. Select second or third H3 item (Test Item 2 or Test Item 3)
  4. Apply "Unfolder Span" (doesn't work, adds garbage spans)

comment:3 Changed 6 years ago by fastballweb

The process of posting my comment helped me realize that it is the HTML comments in my example that are triggering the bug. This is why it works correctly on the first item. After removing the comments, all items work correctly.

It remains to be seen if this is the same issue, but it does produce the same output of empty spans.

Changed 6 years ago by garry.yao

comment:5 Changed 6 years ago by garry.yao

  • Component changed from General to Core : Styles
  • Keywords IE9 Firefox inline styles removed
  • Owner set to garry.yao
  • Status changed from confirmed to review

comment:6 Changed 6 years ago by fredck

  • Milestone set to CKEditor 3.6.2
  • Status changed from review to review_passed

comment:7 Changed 6 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7226].

comment:8 Changed 5 years ago by duncansimey

The problem described in comment 2 still exists. I've raised a ticket for a general solution. #8732 CKEditor creating hidden spans which can result in hidden content

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