Deal with old libxml incompatibilities.
[htmlpurifier.git] / library / HTMLPurifier / TagTransform.php
blob7b8d833433a637cf52fbc2d49c2656e6e73065ca
1 <?php
3 /**
4 * Defines a mutation of an obsolete tag into a valid tag.
5 */
6 abstract class HTMLPurifier_TagTransform
9 /**
10 * Tag name to transform the tag to.
11 * @type string
13 public $transform_to;
15 /**
16 * Transforms the obsolete tag into the valid tag.
17 * @param HTMLPurifier_Token_Tag $tag Tag to be transformed.
18 * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object
19 * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object
21 abstract public function transform($tag, $config, $context);
23 /**
24 * Prepends CSS properties to the style attribute, creating the
25 * attribute if it doesn't exist.
26 * @warning Copied over from AttrTransform, be sure to keep in sync
27 * @param array $attr Attribute array to process (passed by reference)
28 * @param string $css CSS to prepend
30 protected function prependCSS(&$attr, $css)
32 $attr['style'] = isset($attr['style']) ? $attr['style'] : '';
33 $attr['style'] = $css . $attr['style'];
37 // vim: et sw=4 sts=4