1 : <?php
2 :
3 : /**
4 : * XHTML 1.1 Text Module, defines basic text containers. Core Module.
5 : * @note In the normative XML Schema specification, this module
6 : * is further abstracted into the following modules:
7 : * - Block Phrasal (address, blockquote, pre, h1, h2, h3, h4, h5, h6)
8 : * - Block Structural (div, p)
9 : * - Inline Phrasal (abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var)
10 : * - Inline Structural (br, span)
11 : * This module, functionally, does not distinguish between these
12 : * sub-modules, but the code is internally structured to reflect
13 : * these distinctions.
14 : */
15 1 : 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 __construct() {
24 :
25 : // Inline Phrasal -------------------------------------------------
26 1 : $this->addElement('abbr', 'Inline', 'Inline', 'Common');
27 1 : $this->addElement('acronym', 'Inline', 'Inline', 'Common');
28 1 : $this->addElement('cite', 'Inline', 'Inline', 'Common');
29 1 : $this->addElement('code', 'Inline', 'Inline', 'Common');
30 1 : $this->addElement('dfn', 'Inline', 'Inline', 'Common');
31 1 : $this->addElement('em', 'Inline', 'Inline', 'Common');
32 1 : $this->addElement('kbd', 'Inline', 'Inline', 'Common');
33 1 : $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI'));
34 1 : $this->addElement('samp', 'Inline', 'Inline', 'Common');
35 1 : $this->addElement('strong', 'Inline', 'Inline', 'Common');
36 1 : $this->addElement('var', 'Inline', 'Inline', 'Common');
37 :
38 : // Inline Structural ----------------------------------------------
39 1 : $this->addElement('span', 'Inline', 'Inline', 'Common');
40 1 : $this->addElement('br', 'Inline', 'Empty', 'Core');
41 :
42 : // Block Phrasal --------------------------------------------------
43 1 : $this->addElement('address', 'Block', 'Inline', 'Common');
44 1 : $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') );
45 1 : $pre = $this->addElement('pre', 'Block', 'Inline', 'Common');
46 1 : $pre->excludes = $this->makeLookup(
47 1 : 'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' );
48 1 : $this->addElement('h1', 'Heading', 'Inline', 'Common');
49 1 : $this->addElement('h2', 'Heading', 'Inline', 'Common');
50 1 : $this->addElement('h3', 'Heading', 'Inline', 'Common');
51 1 : $this->addElement('h4', 'Heading', 'Inline', 'Common');
52 1 : $this->addElement('h5', 'Heading', 'Inline', 'Common');
53 1 : $this->addElement('h6', 'Heading', 'Inline', 'Common');
54 :
55 : // Block Structural -----------------------------------------------
56 1 : $this->addElement('p', 'Block', 'Inline', 'Common');
57 1 : $this->addElement('div', 'Block', 'Flow', 'Common');
58 :
59 1 : }
60 :
61 : }
62 :
|