Escape characters to mitigate XSS attacks