npm.io
1.0.3 • Published 4 years ago

yizhi-html-escape

Licence
ISC
Version
1.0.3
Deps
0
Size
6 kB
Vulns
0
Weekly
0

yizhi-html-escape

A HTML escape character util. (>_<)

Usage

import {escape, unescape} from 'yizhi-html-escape'

escape('<div>Tom&Jerry</div>')
//Output:
// &lt;div&gt;Tom&amp;Jerry&lt;/div&gt;


unescape('&pi;=3.14, &yen;&cent;&pound;&copy;&reg;')
//Output:
// π=3.14, ¥¢£©®

Keywords