posthtml-remove-attributes

1.0.0 • Public • Published

posthtml-remove-attributes

PostHTML plugin to remove attributes unconditionally or with content match

Dependency Status Current version Travis Build Status

Installation

Install the posthtml-remove-attributes:

$ npm install posthtml-remove-attributes --save

Usage

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1,205
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1,205

Package Sidebar

Install

npm i posthtml-remove-attributes

Weekly Downloads

1,205

Version

1.0.0

License

MIT

Last publish

Collaborators

  • princed