Class HTMLPurifier_Filter_ExtractStyleBlocks

Description

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.

Located in /lib/core/Parsers/htmlpurifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php (line 17)

HTMLPurifier_Filter
   |
   --HTMLPurifier_Filter_ExtractStyleBlocks
Variable Summary
mixed $name
Method Summary
HTMLPurifier_Filter_ExtractStyleBlocks __construct ()
Cleaned cleanCSS ($css $css, $config $config, $context $context)
void preFilter ( $html,  $config,  $context)
void styleCallback ($matches $matches)
Variables
mixed $name = 'ExtractStyleBlocks' (line 20)
  • access: public

Redefinition of:
HTMLPurifier_Filter::$name
Name of the filter for identification purposes
Methods
Constructor __construct (line 24)
  • access: public
HTMLPurifier_Filter_ExtractStyleBlocks __construct ()
cleanCSS (line 63)

Takes CSS (the stuff found in <style>) and cleans it.

  • return: CSS
  • access: public
Cleaned cleanCSS ($css $css, $config $config, $context $context)
  • $css $css: CSS styling to clean
  • $config $config: Instance of HTMLPurifier_Config
  • $context $context: Instance of HTMLPurifier_Context
preFilter (line 40)

Removes inline <style> tags from HTML, saves them for later use

  • todo: Extend to indicate non-text/css style blocks
  • access: public
void preFilter ( $html,  $config,  $context)
  • $html
  • $config
  • $context

Redefinition of:
HTMLPurifier_Filter::preFilter()
Pre-processor function, handles HTML before HTML Purifier
styleCallback (line 32)

Save the contents of CSS blocks to style matches

  • access: protected
void styleCallback ($matches $matches)
  • $matches $matches: preg_replace style $matches array

Inherited Methods

Inherited From HTMLPurifier_Filter

HTMLPurifier_Filter::postFilter()
HTMLPurifier_Filter::preFilter()

Documentation generated on Sun, 06 Mar 2011 00:23:52 -0500 by phpDocumentor 1.4.3