Automatically reformat pasted text