\HTMLPurifier_Filter_ExtractStyleBlocks
This filter extracts <style> blocks from input HTML, cleans them up using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') so they can be used elsewhere in the document.
Synopsis
class HTMLPurifier_Filter_ExtractStyleBlocks
extends HTMLPurifier_Filter
{
- // members
- public string $name = 'ExtractStyleBlocks';
- private array $_styleMatches = ;
- private $_tidy;
- // Inherited members from HTMLPurifier_Filter
- public $name;
- // methods
- public void __construct()
- protected void styleCallback()
- public void preFilter()
- public Cleaned cleanCSS()
- // Inherited methods from HTMLPurifier_Filter
- public void preFilter()
- public void postFilter()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
40+ | Extend to indicate non-text/css style blocks |
Members
private
- $_styleMatches
- $_tidy
public
- $name
-
$name
Name of the filter for identification purposes
Methods
protected
- styleCallback() — Save the contents of CSS blocks to style matches
public
- __construct()
- cleanCSS() — Takes CSS (the stuff found in <style>) and cleans it.
- preFilter() — Removes inline <style> tags from HTML, saves them for later use
Inherited from HTMLPurifier_Filter
public
- postFilter() — Post-processor function, handles HTML after HTML Purifier
- preFilter() — Pre-processor function, handles HTML before HTML Purifier