Strip specific tags from a string of HTML
Install with npm
npm i strip-tags --save
var stripTags = require('strip-tags');
var html = '<head> <link href="abc.css"> <script src="xyz"></script> </head>';
stripTags(html, 'link');
//=> '<head> <script src="xyz"></script> </head>'
stripTags(html, ['link', 'script']);
//=> '<head> </head>'
stripTags(html, 'link,script');
//=> '<head> </head>'
Install dev dependencies:
node i -d && mocha
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on January 18, 2015.