1.0.0 • Published 2 years ago
pete-five v1.0.0
安装
npm install pete-five
导入
const pete = require('pete-five')
html标签转义
let htmlStr = '<h1 style="color: pink;">还就忘了吧,在那些和你错开的时间里,以为能忘了你&map<span></span></h1>'
let result1 = pete.htmlEscape(htmlStr)
console.log(result1);
// <h1 style="color: pink;">还就忘了吧,在那些和你错开的时间里,以为能忘了你&map<span></span></h1>
html转义还原
let result2 = pete.htmlUnEscape(result1)
console.log(result2);
// <h1 style="color: pink;">还就忘了吧,在那些和你错开的时间里,以为能忘了你&map<span></span></h1>
test-split
let str = '1,2,3,4,5'
let result3 = pete.testSplit(str, ',')
console.log(result3);
开源协议
ISC
1.0.0
2 years ago