https://github.com/princed/posthtml-remove-attributes
PostHTML plugin to remove attributes unconditionally or with content match
https://github.com/princed/posthtml-remove-attributes
attributes posthtml posthtml-plugin
Last synced: 12 months ago
JSON representation
PostHTML plugin to remove attributes unconditionally or with content match
- Host: GitHub
- URL: https://github.com/princed/posthtml-remove-attributes
- Owner: princed
- Created: 2016-03-18T16:18:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-01-04T00:59:04.000Z (over 5 years ago)
- Last Synced: 2025-03-23T22:36:56.325Z (about 1 year ago)
- Topics: attributes, posthtml, posthtml-plugin
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[posthtml](https://github.com/posthtml/posthtml)-remove-attributes
==================
PostHTML plugin to remove attributes unconditionally or with content match
[](https://david-dm.org/princed/posthtml-remove-attributes) [](https://greenkeeper.io/)
[](https://www.npmjs.com/package/posthtml-remove-attributes) [](https://travis-ci.org/princed/posthtml-remove-attributes)
Installation
------------
Install the `posthtml-remove-attributes`:
```sh
$ npm install posthtml-remove-attributes --save
```
Usage
-----
```javascript
var posthtml = require('posthtml');
var removeAttributes = require('posthtml-remove-attributes');
var html = '
OMG';
posthtml([
removeAttributes([ // The only non-array argument is also possible
'class', // match name
{name: 'style', value: /inline/} // match name and value
])
])
.process(html)
.then(function(result) {
console.log(result);
});
// Yields:
//
OMG
```
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`.