Strip HTML tags and/or attributes from a string.
npm install js-striphtmljs-striphtml
============
JavaScript module for stripping HTML tags and/or HTML element attributes from strings.
Install
-------
$ npm install js-striphtml
.stripTags(string subject, [ array of strings allowableTags ] );
----------------------------------------------------------------
This function tries to return a string with all HTML tags stripped from a given str.
You can use the optional second parameter to specify tags which should not be stripped.
Example:
var striphtml = require('js-striphtml');
striphtml.striptags('
.stripAttr(string subject, [ object of arrays of strings allowableAttributes ] );
---------------------------
This function tries to return a string with all HTML tag attributes stripped, but with the very HTML tags intact.
You can use the optional second parameter to specify attributes which should not be stripped.
Example:
var striphtml = require('js-striphtml');
striphtml.stripAttr('
I am a HTML string. 
I am a HTML string. 