Ruby.php 923 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * XHTML 1.1 Ruby Annotation Module, defines elements that indicate
  4. * short runs of text alongside base text for annotation or pronounciation.
  5. */
  6. class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
  7. {
  8. public $name = 'Ruby';
  9. public function setup($config) {
  10. $this->addElement('ruby', 'Inline',
  11. 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))',
  12. 'Common');
  13. $this->addElement('rbc', false, 'Required: rb', 'Common');
  14. $this->addElement('rtc', false, 'Required: rt', 'Common');
  15. $rb = $this->addElement('rb', false, 'Inline', 'Common');
  16. $rb->excludes = array('ruby' => true);
  17. $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number'));
  18. $rt->excludes = array('ruby' => true);
  19. $this->addElement('rp', false, 'Optional: #PCDATA', 'Common');
  20. }
  21. }
  22. // vim: et sw=4 sts=4