Cache the unsafe-html-chars regex and enhance XSS unit test