export class HtmlUtils { private static entityMap = { "&" : "&amp;" , "<" : "&lt;" , ">" : "&gt;" , "\"" : "&quot;" , "\"\"" : "&quot;" , "'" : "&#39;" , "/" : "&#x2F;" } ; public static escapeHTML ( source ) { return String ( source ) . replace ( /[&<>"'\/]/g , s => HtmlUtils . entityMap [ s ] ) ; } }