0.0.4 • Published 8 years ago

posthtml-remove-duplicates v0.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

Posthtml-remove-duplicates

NPM version Travis Build Status XO code style

Installation

$ npm i --save posthtml-remove-duplicates

Usage

<!-- index.html -->
<html>
<body>
  <style>.a {color: black;}</style>
  <style>.a {color: black;}</style>
</body>
</html>
/* index.js */
var fs = require('fs');
var posthtml = require('posthtml');

posthtml()
  .use(require('posthtml-remove-duplicates')('style'))
  .process(fs.readFileSync('index.html', 'utf8'))
  .then(function(result) {
    return result; 

    /**
     * <html>
     *  <body>
     *    <style>.a {color: black;}</style>
     *  </body>
     * </html>
     */
  });

Api

selector: string: Selector to match html elements, passed to posthtml-match-helper.

License

MIT © Aleksandr Yakunichev