It does not work with this code answer:
function convertHTML(str) {
let result = str
.replaceAll('>', '>')
.replaceAll('<', '&lt;')
.replaceAll("&", '&amp;')
.replaceAll("'", '&apos;')
.replaceAll('"', '&quote;');
return result;
}
convertHTML('Dolce & Gabbana');