Sanitize markdown editor input