File "Bdo.php"

Full Path: /home/spiraleeea/www/spirale/plugins-dist/safehtml/lib/xemlock/htmlpurifier-html5/library/HTMLPurifier/HTMLModule/HTML5/Bdo.php
File size: 1.08 KB
MIME-type: text/x-php
Charset: utf-8

<?php

/**
 * HTML5 Bi-directional text
 */
class HTMLPurifier_HTMLModule_HTML5_Bdo extends HTMLPurifier_HTMLModule
{
    /**
     * @type string
     */
    public $name = 'HTML5_Bdo';

    /**
     * @type array
     */
    public $attr_collections = array(
        'I18N' => array(
            'dir' => 'Enum#ltr,rtl,auto',
        ),
    );

    /**
     * @param HTMLPurifier_Config $config
     */
    public function setup($config)
    {
        // Bidirectional Text Override element
        // https://www.w3.org/TR/html50/text-level-semantics.html#the-bdo-element
        $bdo = $this->addElement(
            'bdo',
            'Inline',
            'Inline',
            'Common',
            array(
                'dir' => 'Enum#ltr,rtl', // required, the 'auto' value must not be specified
            )
        );
        $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir();

        // Bidirectional Isolate element
        // https://www.w3.org/TR/html50/text-level-semantics.html#the-bdi-element
        $this->addElement('bdi', 'Inline', 'Inline', 'Common');
    }
}