4 * XHTML 1.1 Legacy module defines elements that were previously
7 * @note Not all legacy elements have been implemented yet, which
8 * is a bit of a reverse problem as compared to browsers! In
9 * addition, this legacy module may implement a bit more than
10 * mandated by XHTML 1.1.
12 * This module can be used in combination with TransformToStrict in order
13 * to transform as many deprecated elements as possible, but retain
14 * questionably deprecated elements that do not have good alternatives
15 * as well as transform elements that don't have an implementation.
16 * See docs/ref-strictness.txt for more details.
19 class HTMLPurifier_HTMLModule_Legacy
extends HTMLPurifier_HTMLModule
25 var $elements = array('u', 's', 'strike');
26 var $non_standalone_elements = array('li', 'ol', 'address', 'blockquote');
28 function HTMLPurifier_HTMLModule_Legacy() {
30 foreach ($this->elements
as $name) {
31 $this->info
[$name] = new HTMLPurifier_ElementDef();
32 // for u, s, strike, as more elements get added, add
33 // conditionals as necessary
34 $this->info
[$name]->content_model
= 'Inline | #PCDATA';
35 $this->info
[$name]->content_model_type
= 'optional';
36 $this->info
[$name]->attr
[0] = array('Common');
39 // setup modifications to old elements
40 foreach ($this->non_standalone_elements
as $name) {
41 $this->info
[$name] = new HTMLPurifier_ElementDef();
42 $this->info
[$name]->standalone
= false;
45 $this->info
['li']->attr
['value'] = new HTMLPurifier_AttrDef_Integer();
46 $this->info
['ol']->attr
['start'] = new HTMLPurifier_AttrDef_Integer();
48 $this->info
['address']->content_model
= 'Inline | #PCDATA | p';
49 $this->info
['address']->content_model_type
= 'optional';
50 $this->info
['address']->child
= false;
52 $this->info
['blockquote']->content_model
= 'Flow | #PCDATA';
53 $this->info
['blockquote']->content_model_type
= 'optional';
54 $this->info
['blockquote']->child
= false;