htmlDecode
Decode the string from HTML entities, converting specific HTML entities (such as <
, >
, &
) back to their corresponding plain characters (e.g., <, >, &).
Added in v0.0.1
Usage
ts
import { htmlDecode } from 'parsnip-kit'
htmlDecode(''test'') // '\'test\''
htmlDecode('"test"') // '"test"'
htmlDecode('<img/>') // '<img/>'
htmlDecode('talk & code') // 'talk & code'
API
Arguments
Arg | Type | Optional | Default | Description |
---|---|---|---|---|
arg | any | false | undefined | The string to be converted. |
Returns
Type |
---|
string |