Formatting text does not work if the selected text does contain HTML tags
When formatting text (e.g. applying "code" format) to selected text, text might accidentally get stripped. It seems that the current way of doing the editing removed any contained HTML tags.