File: EndInsertInjector.php

package info (click to toggle)
php-htmlpurifier 4.4.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,888 kB
  • sloc: php: 27,456; xml: 1,767; makefile: 68; sh: 14
file content (18 lines) | stat: -rw-r--r-- 489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

class HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjector extends HTMLPurifier_Injector
{
    public $name = 'EndInsertInjector';
    public $needed = array('span');
    public function handleEnd(&$token) {
        if ($token->name == 'div') return;
        $token = array(
            new HTMLPurifier_Token_Start('b'),
            new HTMLPurifier_Token_Text('Comment'),
            new HTMLPurifier_Token_End('b'),
            $token
        );
    }
}

// vim: et sw=4 sts=4