xref: /dokuwiki/inc/Parsing/ParserMode/Camelcaselink.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 Camelcaselink extends AbstractMode
8be906b56SAndreas Gohr{
9be906b56SAndreas Gohr    /** @inheritdoc */
10*71096e46SAndreas Gohr    public function getSort()
11*71096e46SAndreas Gohr    {
12*71096e46SAndreas Gohr        return 290;
13*71096e46SAndreas Gohr    }
14*71096e46SAndreas Gohr
15*71096e46SAndreas Gohr    /** @inheritdoc */
16be906b56SAndreas Gohr    public function connectTo($mode)
17be906b56SAndreas Gohr    {
18be906b56SAndreas Gohr        $this->Lexer->addSpecialPattern(
19be906b56SAndreas Gohr            '\b[A-Z]+[a-z]+[A-Z][A-Za-z]*\b',
20be906b56SAndreas Gohr            $mode,
21be906b56SAndreas Gohr            'camelcaselink'
22be906b56SAndreas Gohr        );
23be906b56SAndreas Gohr    }
24be906b56SAndreas Gohr
25be906b56SAndreas Gohr    /** @inheritdoc */
26*71096e46SAndreas Gohr    public function handle($match, $state, $pos, Handler $handler)
27be906b56SAndreas Gohr    {
28*71096e46SAndreas Gohr        $handler->addCall('camelcaselink', [$match], $pos);
29*71096e46SAndreas Gohr        return true;
30be906b56SAndreas Gohr    }
31be906b56SAndreas Gohr}
32