escape function

String escape(
  1. String str
)

Replaces HTML-unsafe characters with their entity equivalents.

Escapes &, <, >, ", ', `, / and \.

Example:

escape('<script>'); // '&lt;script&gt;'

Implementation

String escape(String str) => _escape(str);