ensure newlines are escaped when wrapping code
newlines are treated as whitespace for html