Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-04T00:59:04.000Z (almost 4 years ago)
- Last Synced: 2024-09-14T01:57:47.669Z (2 months 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
[![Dependency Status](https://img.shields.io/david/princed/posthtml-remove-attributes.svg?style=flat-square)](https://david-dm.org/princed/posthtml-remove-attributes) [![Greenkeeper badge](https://badges.greenkeeper.io/princed/posthtml-remove-attributes.svg)](https://greenkeeper.io/)
[![Current version](https://img.shields.io/npm/v/posthtml-remove-attributes.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-remove-attributes) [![Travis Build Status](https://img.shields.io/travis/princed/posthtml-remove-attributes.svg?style=flat-square)](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`.