1 | <?php |
||
7 | class MarkdownEngine extends \ParsedownExtra implements ParsingEngine |
||
8 | { |
||
9 | protected $highlighter; |
||
10 | |||
11 | 4 | public function __construct () |
|
17 | |||
18 | 3 | protected function blockHeader($line) |
|
19 | { |
||
20 | 3 | $Block = parent::blockHeader($line); |
|
21 | |||
22 | // Create our unique ids by sanitizing the header content |
||
23 | 3 | $id = strtolower($Block['element']['text']); |
|
24 | 3 | $id = str_replace(' ', '-', $id); |
|
25 | 3 | $id = preg_replace('/[^0-9a-zA-Z-_]/', '', $id); |
|
26 | 3 | $id = preg_replace('/-+/', '-', $id); |
|
27 | |||
28 | 3 | $Block['element']['attributes']['id'] = $id; |
|
29 | |||
30 | 3 | return $Block; |
|
31 | } |
||
32 | |||
33 | 3 | public function blockFencedCodeComplete ($block) |
|
59 | } |