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

45 lines
1 KiB
PHP
Raw Normal View History

2010-09-09 05:14:17 +02: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 11:06:17 +01:00
/**
* @type string
*/
2010-09-09 05:14:17 +02:00
public $name = 'Bdo';
2016-02-09 11:06:17 +01:00
/**
* @type array
*/
2010-09-09 05:14:17 +02:00
public $attr_collections = array(
'I18N' => array('dir' => false)
);
2016-02-09 11:06:17 +01:00
/**
* @param HTMLPurifier_Config $config
*/
public function setup($config)
{
2010-09-09 05:14:17 +02:00
$bdo = $this->addElement(
2016-02-09 11:06:17 +01:00
'bdo',
'Inline',
'Inline',
array('Core', 'Lang'),
2010-09-09 05:14:17 +02:00
array(
'dir' => 'Enum#ltr,rtl', // required
// The Abstract Module specification has the attribute
// inclusions wrong for bdo: bdo allows Lang
)
);
2016-02-09 11:06:17 +01:00
$bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir();
2010-09-09 05:14:17 +02:00
$this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
}
}
// vim: et sw=4 sts=4