Clean up the text pasted into the medium editor