The only sane solution I've yet seen is WYMeditor[1]. All the ease and immediacy of WYSIWYG, but producing proper standards-compliant code with the classes you choose. The code's not brilliant (having Rangy mixed in to cope with legacy IE annoys me), but the concept is so far ahead of anything else that I now use it pretty much exclusively for in-browser editing; as a professional writer I could never rewire my habits to the obtrusive markup of Markdown.