xref: /dokuwiki/inc/Parsing/ParserMode/Hr.php (revision 71096e46fcbfaeaa808667aba794e77fe2780169)
1be906b56SAndreas Gohr<?php
2be906b56SAndreas Gohr
3be906b56SAndreas Gohrnamespace dokuwiki\Parsing\ParserMode;
4be906b56SAndreas Gohr
5*71096e46SAndreas Gohruse dokuwiki\Parsing\Handler;
6*71096e46SAndreas Gohr
7be906b56SAndreas Gohrclass Hr extends AbstractMode
8be906b56SAndreas Gohr{
9be906b56SAndreas Gohr    /** @inheritdoc */
10*71096e46SAndreas Gohr    public function getSort()
11*71096e46SAndreas Gohr    {
12*71096e46SAndreas Gohr        return 160;
13*71096e46SAndreas Gohr    }
14*71096e46SAndreas Gohr
15*71096e46SAndreas Gohr    /** @inheritdoc */
16be906b56SAndreas Gohr    public function connectTo($mode)
17be906b56SAndreas Gohr    {
18be906b56SAndreas Gohr        $this->Lexer->addSpecialPattern('\n[ \t]*-{4,}[ \t]*(?=\n)', $mode, 'hr');
19be906b56SAndreas Gohr    }
20be906b56SAndreas Gohr
21be906b56SAndreas Gohr    /** @inheritdoc */
22*71096e46SAndreas Gohr    public function handle($match, $state, $pos, Handler $handler)
23be906b56SAndreas Gohr    {
24*71096e46SAndreas Gohr        $handler->addCall('hr', [], $pos);
25*71096e46SAndreas Gohr        return true;
26be906b56SAndreas Gohr    }
27be906b56SAndreas Gohr}
28