Escape newlines correctly.