1<?php
2
3namespace dokuwiki\Parsing\ParserMode;
4
5class Quote extends AbstractMode
6{
7    /**
8     * Quote constructor.
9     */
10    public function __construct()
11    {
12        global $PARSER_MODES;
13
14        $this->allowedModes = array_merge(
15            $PARSER_MODES['formatting'],
16            $PARSER_MODES['substition'],
17            $PARSER_MODES['disabled'],
18            $PARSER_MODES['protected']
19        );
20    }
21
22    /** @inheritdoc */
23    public function connectTo($mode)
24    {
25        $this->Lexer->addEntryPattern('\n>{1,}', $mode, 'quote');
26    }
27
28    /** @inheritdoc */
29    public function postConnect()
30    {
31        $this->Lexer->addPattern('\n>{1,}', 'quote');
32        $this->Lexer->addExitPattern('\n', 'quote');
33    }
34
35    /** @inheritdoc */
36    public function getSort()
37    {
38        return 220;
39    }
40}
41