xref: /dokuwiki/inc/Parsing/ParserMode/Notoc.php (revision 504c13e8df88563c11b3720b317991bc38835a35)
1<?php
2
3namespace dokuwiki\Parsing\ParserMode;
4
5use dokuwiki\Parsing\Handler;
6
7class Notoc extends AbstractMode
8{
9    /** @inheritdoc */
10    public function getSort()
11    {
12        return 30;
13    }
14
15    /** @inheritdoc */
16    public function connectTo($mode)
17    {
18        $this->Lexer->addSpecialPattern('~~NOTOC~~', $mode, 'notoc');
19    }
20
21    /** @inheritdoc */
22    public function handle($match, $state, $pos, Handler $handler)
23    {
24        $handler->addCall('notoc', [], $pos);
25        return true;
26    }
27}
28