Fix newline and HTML escaping