sanitize pasted input before inserting into text editor