An open API service indexing awesome lists of open source software.

https://github.com/yacodes/posthtml-remove-duplicates

Remove duplicate tags from html
https://github.com/yacodes/posthtml-remove-duplicates

Last synced: about 2 months ago
JSON representation

Remove duplicate tags from html

Awesome Lists containing this project

README

        

# Posthtml-remove-duplicates

[![NPM version](http://img.shields.io/npm/v/posthtml-remove-duplicates.svg)](https://www.npmjs.org/package/posthtml-remove-duplicates)
[![Travis Build Status](https://travis-ci.org/canvaskisa/posthtml-remove-duplicates.svg)](https://travis-ci.org/canvaskisa/posthtml-remove-duplicates)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)

## Installation
```console
$ npm i --save posthtml-remove-duplicates
```

## Usage
```html

.a {color: black;}
.a {color: black;}

```

```js
/* 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;

/**
*
*
* .a {color: black;}
*
*
*/
});
```

## Api
`selector: string`: Selector to match html elements, passed to [posthtml-match-helper](https://github.com/rasmusfl0e/posthtml-match-helper).

## License
MIT © [Aleksandr Yakunichev](https://github.com/canvaskisa)