1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15: class HTMLPurifier_HTMLModule_Text extends HTMLPurifier_HTMLModule
16: {
17:
18: public $name = 'Text';
19: public $content_sets = array(
20: 'Flow' => 'Heading | Block | Inline'
21: );
22:
23: public function setup($config) {
24:
25:
26: $this->addElement('abbr', 'Inline', 'Inline', 'Common');
27: $this->addElement('acronym', 'Inline', 'Inline', 'Common');
28: $this->addElement('cite', 'Inline', 'Inline', 'Common');
29: $this->addElement('dfn', 'Inline', 'Inline', 'Common');
30: $this->addElement('kbd', 'Inline', 'Inline', 'Common');
31: $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI'));
32: $this->addElement('samp', 'Inline', 'Inline', 'Common');
33: $this->addElement('var', 'Inline', 'Inline', 'Common');
34:
35: $em = $this->addElement('em', 'Inline', 'Inline', 'Common');
36: $em->formatting = true;
37:
38: $strong = $this->addElement('strong', 'Inline', 'Inline', 'Common');
39: $strong->formatting = true;
40:
41: $code = $this->addElement('code', 'Inline', 'Inline', 'Common');
42: $code->formatting = true;
43:
44:
45: $this->addElement('span', 'Inline', 'Inline', 'Common');
46: $this->addElement('br', 'Inline', 'Empty', 'Core');
47:
48:
49: $this->addElement('address', 'Block', 'Inline', 'Common');
50: $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') );
51: $pre = $this->addElement('pre', 'Block', 'Inline', 'Common');
52: $pre->excludes = $this->makeLookup(
53: 'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' );
54: $this->addElement('h1', 'Heading', 'Inline', 'Common');
55: $this->addElement('h2', 'Heading', 'Inline', 'Common');
56: $this->addElement('h3', 'Heading', 'Inline', 'Common');
57: $this->addElement('h4', 'Heading', 'Inline', 'Common');
58: $this->addElement('h5', 'Heading', 'Inline', 'Common');
59: $this->addElement('h6', 'Heading', 'Inline', 'Common');
60:
61:
62: $p = $this->addElement('p', 'Block', 'Inline', 'Common');
63: $p->autoclose = array_flip(array("address", "blockquote", "center", "dir", "div", "dl", "fieldset", "ol", "p", "ul"));
64:
65: $this->addElement('div', 'Block', 'Flow', 'Common');
66:
67: }
68:
69: }
70:
71:
72: