diff --git a/library/HTMLPurifier/HTML5Config.php b/library/HTMLPurifier/HTML5Config.php
index a88e4f4..42cfc4d 100644
--- a/library/HTMLPurifier/HTML5Config.php
+++ b/library/HTMLPurifier/HTML5Config.php
@@ -2,7 +2,7 @@
class HTMLPurifier_HTML5Config extends HTMLPurifier_Config
{
- const REVISION = 2018061701;
+ const REVISION = 2018081401;
/**
* @param string|array|HTMLPurifier_Config $config
diff --git a/library/HTMLPurifier/HTML5Definition.php b/library/HTMLPurifier/HTML5Definition.php
index db98066..644a3a2 100644
--- a/library/HTMLPurifier/HTML5Definition.php
+++ b/library/HTMLPurifier/HTML5Definition.php
@@ -17,6 +17,9 @@ public static function setup(HTMLPurifier_HTMLDefinition $def)
// add support for Floating point number attributes
$def->manager->attrTypes->set('Float', new HTMLPurifier_AttrDef_Float());
+ // add support for Ruby markup
+ $def->manager->addModule('HTML5_Ruby');
+
// http://developers.whatwg.org/sections.html
$def->addElement('section', 'Block', 'Flow', 'Common');
$def->addElement('nav', 'Block', 'Flow', 'Common');
diff --git a/library/HTMLPurifier/HTMLModule/HTML5/Ruby.php b/library/HTMLPurifier/HTMLModule/HTML5/Ruby.php
new file mode 100644
index 0000000..45fdd82
--- /dev/null
+++ b/library/HTMLPurifier/HTMLModule/HTML5/Ruby.php
@@ -0,0 +1,36 @@
+addElement(
+ 'ruby',
+ 'Inline',
+ 'Custom: ((rb | Inline | #PCDATA)*, (rt | (rp, rt, rp) | rtc))+',
+ 'Common'
+ );
+ $this->addElement('rtc', false, 'Custom: (rt | rp | Inline | #PCDATA)*', 'Common');
+ $this->addElement('rb', false, 'Custom: (Inline | #PCDATA)*', 'Common');
+ $this->addElement('rt', false, 'Custom: (Inline | #PCDATA)*', 'Common');
+ $this->addElement('rp', false, 'Custom: (Inline | #PCDATA)*', 'Common');
+
+ // elements can be nested as children of