When you type text manually in a Rich Text Editor and you
change the background color of the Rich Text Editors textArea, most
of the markup will disappear. If you add text by pressing by code
(by pressing the a button for example), the markup will remain when
you change the background color.
By having a button that adds text and removes that text
again, before it changes the background color, you get a
work-around. People then can manually type text and change the
background color without losing their markup.
But this still is a very ugly fix. And I wonder what actually
is the problem? And if there is a better solution.
PS. If you compile the attached code, you will see exactly
what I mean.