escapeHTML method

String escapeHTML()

Return the HTML escaped version of a string

Implementation

String escapeHTML() => this
    .split('')
    .map((e) => REGEXP_HTML_SPECIAL_CHARACTERS.hasMatch(e)
        ? _escapeCharactersMap[e]
        : e)
    .join();