sanitizer content nodejs
//first install package: npm install sanitize-html --save
var sanitizeHtml = require('sanitize-html');
var dirty = 'This is test <a style="opacity: 0.1" href="javascript:void(0)">Link</a>';
var clean = sanitizeHtml(dirty);
console.log(clean);
//result: This is test <a>Link</a>
Also in JavaScript:
- angular get current time
- npm google map api react
- javascript convert string to json object
- array from javascript
- javascript hasclass
- js create element
- tuple angular
- convert datetime javascript mysql
- gatsbyjs image sharp
- current window url jquery
- variable key name js
- javascript send post data with ajax
- add class when element in viewport vanilla javascript
- install nuxt js
- javascript set header text
- use node js to check if a json file exists
- remove json javascript
- react js iterate object
- what is package.json
- jquery validator Date
- cjs.js
- settimeout arrow function javascript
- sum of input vue js
- fill array with values javascript