php-extended/php-html-transformer-doctype-filter

This package is abandoned and no longer maintained. The author suggests using the php-extended/php-html-transformer-object package instead.

A filter for html trees that removes comment nodes.

3.1.16 2021-06-25 15:05 UTC

README

A filter for html trees that removes doctype nodes.

coverage build status

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-doctype-filter": "^3",
		...
	}

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\HtmlTransformerDoctypeFilter;

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

License

MIT (See license file).