Squire HTML5 Rich Text Editor Link
The folks at Fastmail know how to make awesome web tools. They’ve made a freely available HTML5 based text editor called Squire and it’s available on Github
The general philosophy of Squire is to allow the browser to do as much as it can (which unfortunately is not very much), but take control anywhere it deviates from what is required, or there are significant cross-browser differences. As such, the document.execCommand method is not used at all; instead all formatting is done via custom functions, and certain keys, such as ‘enter’ and ‘backspace’ are handled by the editor.