Convert all applicable characters to HTML entities.
Install
Install all functions of strman
yarn add strmanor just the htmlEncode function
yarn add strman.htmlencodeUsage
import { htmlEncode } from 'strman'
// OR
import htmlEncode from 'strman.htmlencode'Parameters:
| Name | Type | Description |
|---|---|---|
value |
String | value to encode. |
- Source:
Returns:
The encoded data.
- Type
- String
Example
htmlEncode('<div>')
// => '<div>'