hp123
v1.0.1
Published
针对html标签的转义
Downloads
1
Readme
安装
npm install hp123
导入
const zhp = require('hp123')
转义html标签特殊字符
let str = '<meta name="viewport" content="width=device-width, initial-scale=1.0">'
let newStr = htmlEsc.htmlEscape(str)
console.log(newStr);
//结果: <meta name="viewport" content="width=device-width, initial-scale=1.0">
还原html标签特殊字符
let str = '<meta name="viewport" content="width=device-width, initial-scale=1.0">'
let newStr = htmlEsc.htmlUnEscape(str)
console.log(newStr)
//结果: <meta name="viewport" content="width=device-width, initial-scale=1.0">