HTMLPurifier 4.4.0
HTMLPurifier_TagTransform_Font Class Reference

Transforms FONT tags to the proper form (SPAN with CSS styling) More...

Inheritance diagram for HTMLPurifier_TagTransform_Font:
HTMLPurifier_TagTransform HTMLPurifier_TagTransform

List of all members.

Public Member Functions

 transform ($tag, $config, $context)
 Transforms the obsolete tag into the valid tag.
 transform ($tag, $config, $context)
 Transforms the obsolete tag into the valid tag.

Public Attributes

 $transform_to = 'span'
 Tag name to transform the tag to.

Protected Attributes

 $_size_lookup

Detailed Description

Transforms FONT tags to the proper form (SPAN with CSS styling)

This transformation takes the three proprietary attributes of FONT and transforms them into their corresponding CSS attributes. These are color, face, and size.

Note:
Size is an interesting case because it doesn't map cleanly to CSS. Thanks to http://style.cleverchimp.com/font_size_intervals/altintervals.html for reasonable mappings.
Warning:
This doesn't work completely correctly; specifically, this TagTransform operates before well-formedness is enforced, so the "active formatting elements" algorithm doesn't get applied.

Definition at line 18 of file Font.php.


Member Function Documentation

HTMLPurifier_TagTransform_Font::transform ( tag,
config,
context 
)

Transforms the obsolete tag into the valid tag.

Parameters:
$tagTag to be transformed.
$configMandatory HTMLPurifier_Config object
$contextMandatory HTMLPurifier_Context object

Reimplemented from HTMLPurifier_TagTransform.

Definition at line 40 of file Font.php.

HTMLPurifier_TagTransform_Font::transform ( tag,
config,
context 
)

Transforms the obsolete tag into the valid tag.

Parameters:
$tagTag to be transformed.
$configMandatory HTMLPurifier_Config object
$contextMandatory HTMLPurifier_Context object

Reimplemented from HTMLPurifier_TagTransform.

Definition at line 16589 of file HTMLPurifier.standalone.php.


Member Data Documentation

HTMLPurifier_TagTransform_Font::$_size_lookup [protected]
Initial value:
 array(
        '0' => 'xx-small',
        '1' => 'xx-small',
        '2' => 'small',
        '3' => 'medium',
        '4' => 'large',
        '5' => 'x-large',
        '6' => 'xx-large',
        '7' => '300%',
        '-1' => 'smaller',
        '-2' => '60%',
        '+1' => 'larger',
        '+2' => '150%',
        '+3' => '200%',
        '+4' => '300%'
    )

Definition at line 23 of file Font.php.

HTMLPurifier_TagTransform_Font::$transform_to = 'span'

Tag name to transform the tag to.

Reimplemented from HTMLPurifier_TagTransform.

Definition at line 21 of file Font.php.


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