1.0.1 • Published 7 years ago
html-escape-translate v1.0.1
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