escapeHtml function
Escape HTML special characters.
Implementation
String escapeHtml(String text) {
return text
.replaceAll('&', '&')
.replaceAll('<', '<')
.replaceAll('>', '>')
.replaceAll('"', '"')
.replaceAll("'", ''');
}