encodeHtml function
Implementation
String encodeHtml(String str, [bool preventDoubleEncoding = true]) {
if (preventDoubleEncoding) {
str = decodeHtml(str);
}
return HtmlEscape(HtmlEscapeMode(
escapeApos: true,
escapeLtGt: true,
escapeQuot: true,
escapeSlash: true,
)).convert(str);
}