Version: v0.7.0 - Beta.  We welcome contributors & feedback.

String.encodeHtml

encodeHtml($options = {}) -> string

Description

Encode special HTML characters (<>&'") into HTML entities.

'1 + 3 > 2'.encodeHtml()  //= '1 + 3 &gt 2'

Options

If $options is -allChars, it will encode all characters in the string.

'abc'.encodeHtml(-allChars)  //= '&#97&#98&#99'

See Also