HumHub Documentation (unofficial)

HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform
in package

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.

Tags
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.

Table of Contents

Properties

$transform_to  : mixed
Tag name to transform the tag to.
$_size_lookup  : mixed

Methods

transform()  : HTMLPurifier_Token_End|string
Transforms the obsolete tag into the valid tag.
prependCSS()  : mixed
Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

Properties

$transform_to

Tag name to transform the tag to.

public mixed $transform_to = 'span'
Tags
type

string

$_size_lookup

protected mixed $_size_lookup = 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%')
Tags
type

array

Methods

prependCSS()

Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

protected prependCSS(array<string|int, mixed> &$attr, string $css) : mixed
Parameters
$attr : array<string|int, mixed>

Attribute array to process (passed by reference)

$css : string

CSS to prepend

Tags
warning

Copied over from AttrTransform, be sure to keep in sync


        
On this page

Search results