escape newlines and tabs in template values