3 require_once 'HTMLPurifier/HTMLModule.php';
6 * XHTML 1.1 Text Module, defines basic text containers. Core Module.
7 * @note In the normative XML Schema specification, this module
8 * is further abstracted into the following modules:
9 * - Block Phrasal (address, blockquote, pre, h1, h2, h3, h4, h5, h6)
10 * - Block Structural (div, p)
11 * - Inline Phrasal (abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var)
12 * - Inline Structural (br, span)
13 * This module, functionally, does not distinguish between these
14 * sub-modules, but the code is internally structured to reflect
17 class HTMLPurifier_HTMLModule_Text
extends HTMLPurifier_HTMLModule
21 var $content_sets = array(
22 'Flow' => 'Heading | Block | Inline'
25 function HTMLPurifier_HTMLModule_Text() {
27 // Inline Phrasal -------------------------------------------------
28 $this->addElement('abbr', true, 'Inline', 'Inline', 'Common');
29 $this->addElement('acronym', true, 'Inline', 'Inline', 'Common');
30 $this->addElement('cite', true, 'Inline', 'Inline', 'Common');
31 $this->addElement('code', true, 'Inline', 'Inline', 'Common');
32 $this->addElement('dfn', true, 'Inline', 'Inline', 'Common');
33 $this->addElement('em', true, 'Inline', 'Inline', 'Common');
34 $this->addElement('kbd', true, 'Inline', 'Inline', 'Common');
35 $this->addElement('q', true, 'Inline', 'Inline', 'Common', array('cite' => 'URI'));
36 $this->addElement('samp', true, 'Inline', 'Inline', 'Common');
37 $this->addElement('strong', true, 'Inline', 'Inline', 'Common');
38 $this->addElement('var', true, 'Inline', 'Inline', 'Common');
40 // Inline Structural ----------------------------------------------
41 $this->addElement('span', true, 'Inline', 'Inline', 'Common');
42 $this->addElement('br', true, 'Inline', 'Empty', 'Core');
44 // Moodle specific elements - start
45 $this->addElement('nolink', true, 'Inline', 'Flow');
46 $this->addElement('tex', true, 'Inline', 'Flow');
47 $this->addElement('algebra', true, 'Inline', 'Flow');
48 $this->addElement('lang', true, 'Inline', 'Flow', 'I18N');
49 // Moodle specific elements - end
51 // Block Phrasal --------------------------------------------------
52 $this->addElement('address', true, 'Block', 'Inline', 'Common');
53 $this->addElement('blockquote', true, 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') );
54 $pre =& $this->addElement('pre', true, 'Block', 'Inline', 'Common');
55 $pre->excludes
= $this->makeLookup(
56 'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' );
57 $this->addElement('h1', true, 'Heading', 'Inline', 'Common');
58 $this->addElement('h2', true, 'Heading', 'Inline', 'Common');
59 $this->addElement('h3', true, 'Heading', 'Inline', 'Common');
60 $this->addElement('h4', true, 'Heading', 'Inline', 'Common');
61 $this->addElement('h5', true, 'Heading', 'Inline', 'Common');
62 $this->addElement('h6', true, 'Heading', 'Inline', 'Common');
64 // Block Structural -----------------------------------------------
65 $this->addElement('p', true, 'Block', 'Inline', 'Common');
66 $this->addElement('div', true, 'Block', 'Flow', 'Common');