1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the league/commonmark package. |
5
|
|
|
* |
6
|
|
|
* (c) Colin O'Dell <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace League\CommonMark; |
13
|
|
|
|
14
|
|
|
use League\CommonMark\Block\Parser\BlockParserInterface; |
15
|
|
|
use League\CommonMark\Block\Renderer\BlockRendererInterface; |
16
|
|
|
use League\CommonMark\Inline\Parser\InlineParserInterface; |
17
|
|
|
use League\CommonMark\Inline\Processor\InlineProcessorInterface; |
18
|
|
|
use League\CommonMark\Inline\Renderer\InlineRendererInterface; |
19
|
|
|
|
20
|
|
|
interface EnvironmentInterface |
21
|
|
|
{ |
22
|
|
|
const HTML_INPUT_STRIP = 'strip'; |
23
|
|
|
const HTML_INPUT_ALLOW = 'allow'; |
24
|
|
|
const HTML_INPUT_ESCAPE = 'escape'; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @param string|null $key |
28
|
|
|
* @param mixed $default |
29
|
|
|
* |
30
|
|
|
* @return mixed |
31
|
|
|
*/ |
32
|
|
|
public function getConfig($key = null, $default = null); |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @return iterable<BlockParserInterface> |
|
|
|
|
36
|
|
|
*/ |
37
|
|
|
public function getBlockParsers(): iterable; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param string $character |
41
|
|
|
* |
42
|
|
|
* @return iterable<InlineParserInterface> |
|
|
|
|
43
|
|
|
*/ |
44
|
|
|
public function getInlineParsersForCharacter(string $character): iterable; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return iterable<InlineProcessorInterface> |
|
|
|
|
48
|
|
|
*/ |
49
|
|
|
public function getInlineProcessors(): iterable; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return iterable<DocumentProcessorInterface> |
|
|
|
|
53
|
|
|
*/ |
54
|
|
|
public function getDocumentProcessors(): iterable; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param string $blockClass |
58
|
|
|
* |
59
|
|
|
* @return iterable<BlockRendererInterface> |
|
|
|
|
60
|
|
|
*/ |
61
|
|
|
public function getBlockRenderersForClass(string $blockClass): iterable; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @param string $inlineClass |
65
|
|
|
* |
66
|
|
|
* @return iterable<InlineRendererInterface> |
|
|
|
|
67
|
|
|
*/ |
68
|
|
|
public function getInlineRenderersForClass(string $inlineClass): iterable; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Regex which matches any character which doesn't indicate an inline element |
72
|
|
|
* |
73
|
|
|
* This allows us to parse multiple non-special characters at once |
74
|
|
|
* |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
|
|
public function getInlineParserCharacterRegex(): string; |
78
|
|
|
} |
79
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.