HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/HTMLModule/Text.php
Go to the documentation of this file.
00001 <?php
00002 
00015 class HTMLPurifier_HTMLModule_Text extends HTMLPurifier_HTMLModule
00016 {
00017 
00018     public $name = 'Text';
00019     public $content_sets = array(
00020         'Flow' => 'Heading | Block | Inline'
00021     );
00022 
00023     public function setup($config) {
00024 
00025         // Inline Phrasal -------------------------------------------------
00026         $this->addElement('abbr',    'Inline', 'Inline', 'Common');
00027         $this->addElement('acronym', 'Inline', 'Inline', 'Common');
00028         $this->addElement('cite',    'Inline', 'Inline', 'Common');
00029         $this->addElement('dfn',     'Inline', 'Inline', 'Common');
00030         $this->addElement('kbd',     'Inline', 'Inline', 'Common');
00031         $this->addElement('q',       'Inline', 'Inline', 'Common', array('cite' => 'URI'));
00032         $this->addElement('samp',    'Inline', 'Inline', 'Common');
00033         $this->addElement('var',     'Inline', 'Inline', 'Common');
00034 
00035         $em = $this->addElement('em',      'Inline', 'Inline', 'Common');
00036         $em->formatting = true;
00037 
00038         $strong = $this->addElement('strong',  'Inline', 'Inline', 'Common');
00039         $strong->formatting = true;
00040 
00041         $code = $this->addElement('code',    'Inline', 'Inline', 'Common');
00042         $code->formatting = true;
00043 
00044         // Inline Structural ----------------------------------------------
00045         $this->addElement('span', 'Inline', 'Inline', 'Common');
00046         $this->addElement('br',   'Inline', 'Empty',  'Core');
00047 
00048         // Block Phrasal --------------------------------------------------
00049         $this->addElement('address',     'Block', 'Inline', 'Common');
00050         $this->addElement('blockquote',  'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') );
00051         $pre = $this->addElement('pre', 'Block', 'Inline', 'Common');
00052         $pre->excludes = $this->makeLookup(
00053             'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' );
00054         $this->addElement('h1', 'Heading', 'Inline', 'Common');
00055         $this->addElement('h2', 'Heading', 'Inline', 'Common');
00056         $this->addElement('h3', 'Heading', 'Inline', 'Common');
00057         $this->addElement('h4', 'Heading', 'Inline', 'Common');
00058         $this->addElement('h5', 'Heading', 'Inline', 'Common');
00059         $this->addElement('h6', 'Heading', 'Inline', 'Common');
00060 
00061         // Block Structural -----------------------------------------------
00062         $p = $this->addElement('p', 'Block', 'Inline', 'Common');
00063         $p->autoclose = array_flip(array("address", "blockquote", "center", "dir", "div", "dl", "fieldset", "ol", "p", "ul"));
00064 
00065         $this->addElement('div', 'Block', 'Flow', 'Common');
00066 
00067     }
00068 
00069 }
00070 
00071 // vim: et sw=4 sts=4