File indexing completed on 2024-05-19 06:02:35

0001 <?php
0002 
0003 /**
0004  * XHTML 1.1 Ruby Annotation Module, defines elements that indicate
0005  * short runs of text alongside base text for annotation or pronounciation.
0006  */
0007 class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
0008 {
0009 
0010     /**
0011      * @type string
0012      */
0013     public $name = 'Ruby';
0014 
0015     /**
0016      * @param HTMLPurifier_Config $config
0017      */
0018     public function setup($config)
0019     {
0020         $this->addElement(
0021             'ruby',
0022             'Inline',
0023             'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))',
0024             'Common'
0025         );
0026         $this->addElement('rbc', false, 'Required: rb', 'Common');
0027         $this->addElement('rtc', false, 'Required: rt', 'Common');
0028         $rb = $this->addElement('rb', false, 'Inline', 'Common');
0029         $rb->excludes = array('ruby' => true);
0030         $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number'));
0031         $rt->excludes = array('ruby' => true);
0032         $this->addElement('rp', false, 'Optional: #PCDATA', 'Common');
0033     }
0034 }
0035 
0036 // vim: et sw=4 sts=4