wysiwyg editor like stackoverflow for inserting code and also markdown.

wysiwyg editor like stackoverflow for inserting code and also markdown.

Hey guys , 

do any of you know of a really good wysiwyg editor ? I want this editor to be able to accept code and also maybe markdown. something like how the stackoverflow editor works. 

The one i am using now is TINYMCE. I like the way i am able to display code in the frontend like so:



But what i also want to do is insert markdown like how its done on stackoverflow, like so:

Something like what you see here:



Any plugin that can be useful for doing this ?

Thank you.
Gautam.