File: EndInsertInjector.php

package info (click to toggle)
php-htmlpurifier 4.1.1%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,556 kB
  • ctags: 6,547
  • sloc: php: 26,336; xml: 1,630; makefile: 70; 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