wty-tools-wty

提供了格式化事件,HTMLEscape

Usage no npm install needed!

<script type="module">
  import wtyToolsWty from 'https://cdn.skypack.dev/wty-tools-wty';
</script>

README

安装

npm i wty-tools-wty

导入

const lvge = require('./wty-tools-wty')

格式化时间

const str0 = lvge.dateFormat(new Date())
console.log(str0)

测试转义

const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
const str = lvge.htmlEscape(htmlStr)
console.log(str)

测试还原

const str2 = lvge.htmlUnEscape(str)
console.log(str2)