1 | <?php |
||
15 | class Creole extends \cebe\markdown\Parser |
||
16 | { |
||
17 | // include block element parsing using traits |
||
18 | use block\CodeTrait; |
||
19 | use block\HeadlineTrait; |
||
20 | use block\ListTrait; |
||
21 | use block\TableTrait; |
||
22 | use block\RuleTrait; |
||
23 | use block\RawHtmlTrait; |
||
24 | |||
25 | // include inline element parsing using traits |
||
26 | use inline\CodeTrait; |
||
27 | use inline\EmphStrongTrait; |
||
28 | use inline\LinkTrait; |
||
29 | |||
30 | /** |
||
31 | * @var boolean whether to format markup according to HTML5 spec. |
||
32 | * Defaults to `true` which means that markup is formatted as HTML5. |
||
33 | * If you want HTML4, set it to false. |
||
34 | */ |
||
35 | public $html5 = true; |
||
36 | |||
37 | /** |
||
38 | * Consume lines for a paragraph |
||
39 | * |
||
40 | * Allow block elements to break paragraphs |
||
41 | */ |
||
42 | 18 | protected function consumeParagraph($lines, $current) |
|
59 | |||
60 | /** |
||
61 | * Checks if the paragraph ends |
||
62 | * @param $line |
||
63 | * @return bool true if end of paragraph |
||
64 | */ |
||
65 | 18 | protected function isParagraphEnd($line) |
|
80 | |||
81 | |||
82 | /** |
||
83 | * Parses escaped special characters. |
||
84 | * Creole uses tilde (~) for the escaping marker. |
||
85 | * It should escape the next character whatever it would be. |
||
86 | * @marker ~ |
||
87 | */ |
||
88 | 2 | protected function parseEscape($text) |
|
95 | |||
96 | /** |
||
97 | * @inheritdocs |
||
98 | * |
||
99 | * Parses a newline indicated by two backslashes, and |
||
100 | * escape '&', '<', and '>'. |
||
101 | */ |
||
102 | 22 | protected function renderText($text) |
|
109 | } |
||
110 |