markdown to html before sending to server
html to markdown when inserting into codemirror