Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
HTMLPurifier_Filter_ExtractStyleBlocks Class Reference
Inheritance diagram for HTMLPurifier_Filter_ExtractStyleBlocks:
HTMLPurifier_Filter

Public Member Functions

 cleanCSS ($css, $config, $context)
 Takes CSS (the stuff found in <style>) and cleans it.
 
 postFilter ($html, $config, $context)
 Post-processor function, handles HTML after HTML Purifier.
 
 preFilter ($html, $config, $context)
 Removes inline <style> tags from HTML, saves them for later use.
 

Public Attributes

 $name = 'ExtractStyleBlocks'
 @type string
 

Protected Member Functions

 styleCallback ($matches)
 Save the contents of CSS blocks to style matches.
 

Member Function Documentation

◆ cleanCSS()

HTMLPurifier_Filter_ExtractStyleBlocks::cleanCSS ( $css,
$config,
$context )

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

Warning
Requires CSSTidy http://csstidy.sourceforge.net/
Parameters
string$cssCSS styling to clean
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Exceptions
HTMLPurifier_Exception
Return values
stringCleaned CSS

◆ postFilter()

HTMLPurifier_Filter::postFilter ( $html,
$config,
$context )
inherited

Post-processor function, handles HTML after HTML Purifier.

Parameters
string$html
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Return values
string

Reimplemented in HTMLPurifier_Filter_YouTube.

◆ preFilter()

HTMLPurifier_Filter_ExtractStyleBlocks::preFilter ( $html,
$config,
$context )

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

Parameters
string$html
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Return values
string
Todo
Extend to indicate non-text/css style blocks

Reimplemented from HTMLPurifier_Filter.

◆ styleCallback()

HTMLPurifier_Filter_ExtractStyleBlocks::styleCallback ( $matches)
protected

Save the contents of CSS blocks to style matches.

Parameters
array$matchespreg_replace style $matches array

The documentation for this class was generated from the following file: