views:

7

answers:

0

Writing a tag extension. Suppose I want tag <foo> to add its character contents as another entry in the page's table of contents. Surrounding the content with == (for instance) doesn't work. It creates an <h2> and 'edit' hyperlink but no TOC update (I've made sure to test with more than four <foo>s since anything less won't render a TOC, by default).

If this is the registered hook function:

    static public function foo( $input, $args, $parser, $frame ) {
        ...
    }

I figured I would use the $parser object, and Parser::formatHeadings(..) seemed like everything I was looking for, despite being marked up as private (in the documentation), but I haven't had any luck. I was hoping someone could point me in the right direction in the considerable API or even better a working example.