LaravelPackages.net
Acme Inc.
Toggle sidebar
kaishiyoku/laravel-html-purifier

A HTML filter using htmlpurifier with additional HTML5 rules.

5.154
0
2.3.0
About kaishiyoku/laravel-html-purifier

kaishiyoku/laravel-html-purifier is a Laravel package for a html filter using htmlpurifier with additional html5 rules.. It currently has 0 GitHub stars and 5.154 downloads on Packagist (latest version 2.3.0). Install it with composer require kaishiyoku/laravel-html-purifier. Discover more Laravel packages by kaishiyoku or browse all Laravel packages to compare alternatives.

Last updated

Maintenance Packagist Packagist

A HTML filter using htmlpurifier with additional HTML5 rules.

Table of contents

General

This package helps purifying HTML markup from unwanted one, like script tags or similar.

It uses the https://github.com/ezyang/htmlpurifier package with some added HTML5 rules.

Installation

Composer

Add "kaishiyoku/laravel-html-purifier": "1.*" to your composer.json by running composer require kaishiyoku/laravel-html-purifier.

Update your dependencies by running composer update.

Usage

$dirtyHtml = '<a href="#">Dirty HTML<script type="text/javascript">alert('purified?');</script></a>';

$purifier = new HtmlPurifier();

$purifiedHtml = $purifier->purify($dirtyHtml);

Output:

<a href="#">Dirty HTML</a>

If you have any issues feel free to open a ticket.

License

MIT (https://github.com/Kaishiyoku/laravel-menu/blob/master/LICENSE)

Author

Twitter: @kaishiyoku
Website: www.andreas-wiedel.de

Star History Chart