/* https://stackoverflow.com/questions/7381974/which-characters-need-to-be-escaped-in-html#7382028 */ function htmlEscape(text) { return String(text) .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """) .replaceAll("'", "'"); }