htmlDecode
将字符串进行 HTML 解码,将特定的 HTML 实体(如 <
、>
、&
)还原为普通字符(如 <、>、&)。
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 | 待转换的字符串 |
Returns
Type |
---|
string |