aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Parsing/ParserMode/Unformatted.php
blob: 58f1435e14830cc2a8a51c23fdf7069f331b07a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace dokuwiki\Parsing\ParserMode;

class Unformatted extends AbstractMode
{
    /** @inheritdoc */
    public function connectTo($mode)
    {
        $this->Lexer->addEntryPattern('<nowiki>(?=.*</nowiki>)', $mode, 'unformatted');
        $this->Lexer->addEntryPattern('%%(?=.*%%)', $mode, 'unformattedalt');
    }

    /** @inheritdoc */
    public function postConnect()
    {
        $this->Lexer->addExitPattern('</nowiki>', 'unformatted');
        $this->Lexer->addExitPattern('%%', 'unformattedalt');
        $this->Lexer->mapHandler('unformattedalt', 'unformatted');
    }

    /** @inheritdoc */
    public function getSort()
    {
        return 170;
    }
}