xref: /dokuwiki/inc/Parsing/ParserMode/Emphasis.php (revision 057ab5a057a76df652cfe4176512a550ca9937f6)
1<?php
2
3namespace dokuwiki\Parsing\ParserMode;
4
5class Emphasis extends AbstractFormatting
6{
7    /** @inheritdoc */
8    public function getSort()
9    {
10        return 80;
11    }
12
13    /** @inheritdoc */
14    protected function getModeName(): string
15    {
16        return 'emphasis';
17    }
18
19    /**
20     * @inheritdoc
21     *
22     * Flanking rules: the opener must be followed by a non-whitespace
23     * character other than a slash, and the closer must be preceded by a
24     * non-whitespace character.
25     */
26    protected function getEntryPattern(): string
27    {
28        return '//(?=[^\s/])';
29    }
30
31    /** @inheritdoc */
32    protected function getExitPattern(): string
33    {
34        return '(?<=[^\s])//';
35    }
36}
37