Licence
—
Version
1.0.1
Deps
0
Vulns
0
Weekly
0
html-escape-translate
将html的'<','>',''', '"', '&' 标签分别转义成 '<', '>, '', '", '&' 或者反向将html的以上5个转义字符翻译成html的以上对应标签。
Example
import { escape, translate } from 'html-escape-translate';
let html = '<a href="http://xxx.com?p=1&q=2"></a>';
let text = "<a href="http://xxx.com?p=1&q=2"></a>";
console.log(escape(html));
console.log(translate(text));
Installation
npm install html-escape-translate