1.0.0 • Published 10 years ago
posthtml-remove-attributes v1.0.0
posthtml-remove-attributes
PostHTML plugin to remove attributes unconditionally or with content match
Installation
Install the posthtml-remove-attributes:
$ npm install posthtml-remove-attributes --saveUsage
var posthtml = require('posthtml');
var html = '<div style="display: inline;" class="wow">OMG</div>';
posthtml([ require('posthtml-remove-attributes')([
'class', {name: style, value: /inline/} // The only non-array argument is also possible
])])
.process(html)
.then(function(result) {
console.log(result);
});
// <div>OMG</div>Contribution guidelines
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using npm test.
1.0.0
10 years ago