1.0.0 • Published 2 years ago
date-html-format v1.0.0
安装
npm install format-utils
导入
const dateHtmlFormat = require('date-html-format')
格式化时间
dateHtmlFormat.dateFormat(new Date())
转义 html 中的特殊字符
const htmlStr = '<h1 title="abc">哈哈哈</h1>'
dateHtmlFormat.htmlUnEscpace(htmlStr)
//转换结果: <h1 title="abc">哈哈哈</h1>
const htmlStr = '<h1 title="abc">哈哈哈</h1>'
dateHtmlFormat.htmlUnEscpace(htmlStr)
//转换结果: <h1 title="abc">哈哈哈</h1>
开源协议
ISC
1.0.0
2 years ago