itheima-tools-xdm
v2.0.0
Published
提供了格式化时间、HTMLEscape相关的功能
Downloads
2
Readme
安装
npm install itheima-tools
导入
const itheima = require('itheima-tools')
格式化时间
const str = itheima.htmlEscape(htmlStr);
console.log(str);
转义html特殊字符串
const htmlStr = `<h1 title="abc">这是h1标签<span>123 </span></h1>`;
const str = itheima.htmlEscape(htmlStr);
console.log(str);
还原html特殊字符串
const str2 = itheima.htmlUnEscape(htmlStr);
console.log(str2);
开源协议
ISC