| 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 | 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 | $this->addElement('abbr', 'Inline', 'Inline', 'Common'); |
|---|
| 27 | $this->addElement('acronym', 'Inline', 'Inline', 'Common'); |
|---|
| 28 | $this->addElement('cite', 'Inline', 'Inline', 'Common'); |
|---|
| 29 | $this->addElement('code', 'Inline', 'Inline', 'Common'); |
|---|
| 30 | $this->addElement('dfn', 'Inline', 'Inline', 'Common'); |
|---|
| 31 | $this->addElement('em', 'Inline', 'Inline', 'Common'); |
|---|
| 32 | $this->addElement('kbd', 'Inline', 'Inline', 'Common'); |
|---|
| 33 | $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI')); |
|---|
| 34 | $this->addElement('samp', 'Inline', 'Inline', 'Common'); |
|---|
| 35 | $this->addElement('strong', 'Inline', 'Inline', 'Common'); |
|---|
| 36 | $this->addElement('var', 'Inline', 'Inline', 'Common'); |
|---|
| 37 | |
|---|
| 38 | // Inline Structural ---------------------------------------------- |
|---|
| 39 | $this->addElement('span', 'Inline', 'Inline', 'Common'); |
|---|
| 40 | $this->addElement('br', 'Inline', 'Empty', 'Core'); |
|---|
| 41 | |
|---|
| 42 | // Block Phrasal -------------------------------------------------- |
|---|
| 43 | $this->addElement('address', 'Block', 'Inline', 'Common'); |
|---|
| 44 | $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') ); |
|---|
| 45 | $pre = $this->addElement('pre', 'Block', 'Inline', 'Common'); |
|---|
| 46 | $pre->excludes = $this->makeLookup( |
|---|
| 47 | 'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' ); |
|---|
| 48 | $this->addElement('h1', 'Heading', 'Inline', 'Common'); |
|---|
| 49 | $this->addElement('h2', 'Heading', 'Inline', 'Common'); |
|---|
| 50 | $this->addElement('h3', 'Heading', 'Inline', 'Common'); |
|---|
| 51 | $this->addElement('h4', 'Heading', 'Inline', 'Common'); |
|---|
| 52 | $this->addElement('h5', 'Heading', 'Inline', 'Common'); |
|---|
| 53 | $this->addElement('h6', 'Heading', 'Inline', 'Common'); |
|---|
| 54 | |
|---|
| 55 | // Block Structural ----------------------------------------------- |
|---|
| 56 | $this->addElement('p', 'Block', 'Inline', 'Common'); |
|---|
| 57 | $this->addElement('div', 'Block', 'Flow', 'Common'); |
|---|
| 58 | |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | } |
|---|
| 62 | |
|---|