2007-08-02 22:44:42 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XHTML 1.1 Ruby Annotation Module, defines elements that indicate
|
|
|
|
* short runs of text alongside base text for annotation or pronounciation.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
public $name = 'Ruby';
|
2007-08-02 22:44:42 +00:00
|
|
|
|
2008-05-22 19:36:59 +00:00
|
|
|
public function setup($config) {
|
2008-04-21 23:28:52 +00:00
|
|
|
$this->addElement('ruby', 'Inline',
|
2007-08-02 22:44:42 +00:00
|
|
|
'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))',
|
|
|
|
'Common');
|
2008-04-21 23:28:52 +00:00
|
|
|
$this->addElement('rbc', false, 'Required: rb', 'Common');
|
|
|
|
$this->addElement('rtc', false, 'Required: rt', 'Common');
|
2008-04-23 02:40:17 +00:00
|
|
|
$rb = $this->addElement('rb', false, 'Inline', 'Common');
|
2007-08-02 22:44:42 +00:00
|
|
|
$rb->excludes = array('ruby' => true);
|
2008-04-23 02:40:17 +00:00
|
|
|
$rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number'));
|
2007-08-02 22:44:42 +00:00
|
|
|
$rt->excludes = array('ruby' => true);
|
2008-04-21 23:28:52 +00:00
|
|
|
$this->addElement('rp', false, 'Optional: #PCDATA', 'Common');
|
2007-08-02 22:44:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|