~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/htmlpurifier/HTMLPurifier/HTMLModule/Ruby.php

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
    public $name = 'Ruby';
11
 
 
12
 
    public function setup($config) {
13
 
        $this->addElement('ruby', 'Inline',
14
 
            'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))',
15
 
            'Common');
16
 
        $this->addElement('rbc', false, 'Required: rb', 'Common');
17
 
        $this->addElement('rtc', false, 'Required: rt', 'Common');
18
 
        $rb = $this->addElement('rb', false, 'Inline', 'Common');
19
 
        $rb->excludes = array('ruby' => true);
20
 
        $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number'));
21
 
        $rt->excludes = array('ruby' => true);
22
 
        $this->addElement('rp', false, 'Optional: #PCDATA', 'Common');
23
 
    }
24
 
 
25
 
}
26
 
 
27
 
// vim: et sw=4 sts=4
 
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