php-extended/php-html-transformer-comment-filter

A filter for html trees that removes cdata nodes.

2.0.1 2020-03-30 06:31 UTC

This package is auto-updated.

Last update: 2020-06-30 07:15:21 UTC


README

A filter for html trees that removes comment nodes.

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-html-transformer-comment-filter": "^2",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

To filter a dom node, do the following :


use PhpExtended\HtmlTransformerCommentFilter;

/* @var $dom \PhpExtended\Html\HtmlAbstractNodeInterface */
$filter = new HtmlTransformerCommentFilter();
$filtered = $filter->transform($dom);
// $filtered instanceof \PhpExtended\Html\HtmlAbstractNodeInterface
// but without comment nodes

License

MIT (See license file).