friendica-github/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php

45 lines
1 KiB
PHP
Raw Normal View History

2010-09-09 03:14:17 +00:00
<?php
/**
* XHTML 1.1 Bi-directional Text Module, defines elements that
* declare directionality of content. Text Extension Module.
*/
class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
{
2016-02-09 10:06:17 +00:00
/**
* @type string
*/
2010-09-09 03:14:17 +00:00
public $name = 'Bdo';
2016-02-09 10:06:17 +00:00
/**
* @type array
*/
2010-09-09 03:14:17 +00:00
public $attr_collections = array(
'I18N' => array('dir' => false)
);
2016-02-09 10:06:17 +00:00
/**
* @param HTMLPurifier_Config $config
*/
public function setup($config)
{
2010-09-09 03:14:17 +00:00
$bdo = $this->addElement(
2016-02-09 10:06:17 +00:00
'bdo',
'Inline',
'Inline',
array('Core', 'Lang'),
2010-09-09 03:14:17 +00:00
array(
'dir' => 'Enum#ltr,rtl', // required
// The Abstract Module specification has the attribute
// inclusions wrong for bdo: bdo allows Lang
)
);
2016-02-09 10:06:17 +00:00
$bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir();
2010-09-09 03:14:17 +00:00
$this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
}
}
// vim: et sw=4 sts=4