xref: /dokuwiki/inc/Parsing/ParserMode/Windowssharelink.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 Windowssharelink extends AbstractMode
8be906b56SAndreas Gohr{
9be906b56SAndreas Gohr    protected $pattern;
10be906b56SAndreas Gohr
11be906b56SAndreas Gohr    /** @inheritdoc */
12*71096e46SAndreas Gohr    public function getSort()
13*71096e46SAndreas Gohr    {
14*71096e46SAndreas Gohr        return 350;
15*71096e46SAndreas Gohr    }
16*71096e46SAndreas Gohr
17*71096e46SAndreas Gohr    /** @inheritdoc */
18be906b56SAndreas Gohr    public function preConnect()
19be906b56SAndreas Gohr    {
20be906b56SAndreas Gohr        $this->pattern = "\\\\\\\\\w+?(?:\\\\[\w\-$]+)+";
21be906b56SAndreas Gohr    }
22be906b56SAndreas Gohr
23be906b56SAndreas Gohr    /** @inheritdoc */
24be906b56SAndreas Gohr    public function connectTo($mode)
25be906b56SAndreas Gohr    {
26be906b56SAndreas Gohr        $this->Lexer->addSpecialPattern(
27be906b56SAndreas Gohr            $this->pattern,
28be906b56SAndreas Gohr            $mode,
29be906b56SAndreas Gohr            'windowssharelink'
30be906b56SAndreas Gohr        );
31be906b56SAndreas Gohr    }
32be906b56SAndreas Gohr
33be906b56SAndreas Gohr    /** @inheritdoc */
34*71096e46SAndreas Gohr    public function handle($match, $state, $pos, Handler $handler)
35be906b56SAndreas Gohr    {
36*71096e46SAndreas Gohr        $handler->addCall('windowssharelink', [$match, null], $pos);
37*71096e46SAndreas Gohr        return true;
38be906b56SAndreas Gohr    }
39be906b56SAndreas Gohr}
40