return cursor to meaningful location after inserting markdown

- {text, cursor} is the formatted text & relative location in that string to put cursor

- this makes the code a bit uglier since calls to markdown helpers need to be destructured, but makes the ui more pleasant for changing between typing and inserting text via button click