When formatting already entered text by selecting it and then pressing one of the toolbar buttons the selection is ignored.

To reproduce:

  1. Select some text in the editor
  2. Hit one of the toolbar buttons that transform a selection, such as bold, italic, blockquote or code formatting.

Expected outcome:

The selected should be formatted.

Actual outcome:

The selection is cleared and the toolbar button behaves as if it was pressed without a selection, i.e. inserting new placeholder text, such as **strong text**.

  • oddly enough it works fine if you use the keyboard shortcuts Commented Mar 15, 2011 at 11:04
  • As for the different behaviour when using the keyboard, @Jeff: maybe Unbalanced HTML tags confuse keyboard shortcuts for wmd editor is somehow related to this as well. I cannot test in IE9 though.
    – Arjan
    Commented Mar 15, 2011 at 11:09
  • Hmm, sounds like somebody's spent some time on Connect.
    – user1228
    Commented Mar 15, 2011 at 14:36

1 Answer 1


Internet Explorer loses the selection when you click one of the buttons. To workaround this, the editor saves the selection in the mousedown event (when it is still there), so it has something to work with in the click event (when it's not there anymore).

The test whether this workaround needs to be used is based on the existence of the selectionStart property of the text area DOM object. Internet Explorer didn't have this property before.

In IE9 this property is available, but the issue is still the same, so the test for selectionStart wasn't enough anymore.

This will work again in the next build.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .