Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   1  <?php
   2  
   3  /**

   4   * XHTML 1.1 Ruby Annotation Module, defines elements that indicate

   5   * short runs of text alongside base text for annotation or pronounciation.

   6   */
   7  class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
   8  {
   9  
  10      /**

  11       * @type string

  12       */
  13      public $name = 'Ruby';
  14  
  15      /**

  16       * @param HTMLPurifier_Config $config

  17       */
  18      public function setup($config)
  19      {
  20          $this->addElement(
  21              'ruby',
  22              'Inline',
  23              'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))',
  24              'Common'
  25          );
  26          $this->addElement('rbc', false, 'Required: rb', 'Common');
  27          $this->addElement('rtc', false, 'Required: rt', 'Common');
  28          $rb = $this->addElement('rb', false, 'Inline', 'Common');
  29          $rb->excludes = array('ruby' => true);
  30          $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number'));
  31          $rt->excludes = array('ruby' => true);
  32          $this->addElement('rp', false, 'Optional: #PCDATA', 'Common');
  33      }
  34  }
  35  
  36  // vim: et sw=4 sts=4