If you get some code of available HTML/Javascript editor, I have no idea how it can help you to write your own. It is apparent that you don't have your own ideas, otherwise you would not ask your question. You will read the code, now what? If you write something using that code, you cannot call the editor you write "yours".
And finding it is way to easy:
http://bit.ly/1eJ4K1V[
^].
—SA