<commit_before># Adrenth.HtmlPurifier

An October CMS plugin which adds a standards compliant HTML filter to October CMS.

HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and agressive parsing to ensure that not only are XSS attacks thwarted, but the resulting HTML is standards compliant.

## Installation

**CLI:**

`php artisan plugin:install Adrenth.HtmlPurifier`

**October CMS:**

Go to Settings > Updates & Plugins > Install plugins and search for 'HtmlPurifier'. 

## Configuration

To configure the filter execute this command:

`php artisan vendor:publish --provider="Adrenth\HtmlPurifier\HtmlPurifierServiceProvider" --tag="config"`

A configuration file named `config/htmlpurifier.php` is now created.

In depth information about configuration parameters can be found here: [http://htmlpurifier.org/live/configdoc/plain.html]().<commit_msg>Update plugin documentation<commit_after># Adrenth.HtmlPurifier

An October CMS plugin which adds a standards compliant HTML filter to October CMS.

HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and agressive parsing to ensure that not only are XSS attacks thwarted, but the resulting HTML is standards compliant.

## Installation

**CLI:**

`php artisan plugin:install Adrenth.HtmlPurifier`

**October CMS:**

Go to Settings > Updates & Plugins > Install plugins and search for 'HtmlPurifier'. 

## Configuration

To configure the filter execute this command:

````
php artisan vendor:publish --provider="Adrenth\HtmlPurifier\HtmlPurifierServiceProvider" --tag="config"
````

A configuration file named `config/htmlpurifier.php` is now created.

In depth information about configuration parameters can be found here: http://htmlpurifier.org/live/configdoc/plain.html

## Usage

Use the `|purify' in your Twig templates to apply the HTML Purifier filter.

````
{{ contentFromCms|purify }}

{{ contentFromExternalSource|purify }}
````

or

````
{{ '<a href="" target="_blank">Some random HTML string</a>'|purify }}
````

For more information about templating in October CMS: http://octobercms.com/docs/markup/templating
{'fraction_non_alphanumeric': 0.08902214022140222, 'fraction_numerical': 0.0, 'mean_word_length': 5.342105263157895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2154113', 'n_tokens_mistral': 611, 'n_tokens_neox': 570, 'n_words': 235}