This package has been deprecated

Author message:

The package is no longer maintained.

@comandeer/css-filter

1.0.1 • Public • Published

css-filter

Build Status Dependency Status devDependency Status

Library for filtering HTML with CSS selectors.


Installation

npm install @comandeer/css-filter [--save]

Usage

Include script in your site:

<script src="node_modules/@comandeer/css-filter/dist/css-filter.umd.js"></script>

Under window.cssFilter you will find our library with some fancy methods (see API docs for details).

The simplest way to use the library is to create filter using the factory:

const filter = cssFilter.default( 'i' );
const filtered = filter.filter( `<div>
	<span>
		<i>Only i tag will be preserved</i>
	</span>
</div>` );

console.log( filtered.innerHTML ); // <i>Only i tag will be preserved</i>

All valid CSS selectors could be used as a rule (however not all valid CSS selectors make sense as such rules…).

Documentation

API docs are available at http://comandeer.github.io/css-filter

Readme

Keywords

Package Sidebar

Install

npm i @comandeer/css-filter

Weekly Downloads

20

Version

1.0.1

License

MIT

Last publish

Collaborators

  • comandeer