improved markditor ui and behavior