1 | <?php |
||
15 | class MarkdownEngine extends \ParsedownExtra implements ParsingEngine |
||
16 | { |
||
17 | protected $highlighter; |
||
18 | |||
19 | 11 | public function __construct() |
|
25 | |||
26 | 10 | protected function blockHeader($Line) |
|
|
|||
27 | { |
||
28 | 10 | $Block = parent::blockHeader($Line); |
|
29 | |||
30 | 10 | if (isset($Block['element']['text'])) |
|
31 | 10 | { |
|
32 | 10 | $Block['element']['attributes']['id'] = $this->slugifyHeader($Block); |
|
33 | 10 | } |
|
34 | |||
35 | 10 | return $Block; |
|
36 | } |
||
37 | |||
38 | 2 | protected function blockSetextHeader($Line, array $Block = null) |
|
39 | { |
||
40 | 2 | $Block = parent::blockSetextHeader($Line, $Block); |
|
41 | |||
42 | 2 | if (isset($Block['element']['name'])) |
|
43 | 2 | { |
|
44 | $element = $Block['element']['name']; |
||
45 | |||
46 | if (in_array($element, ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])) |
||
47 | { |
||
48 | $Block['element']['attributes']['id'] = $this->slugifyHeader($Block); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | 2 | return $Block; |
|
53 | } |
||
54 | |||
55 | 10 | private function slugifyHeader($Block) |
|
63 | |||
64 | 3 | protected function blockFencedCodeComplete($block) |
|
65 | { |
||
90 | } |
||
91 |
This check marks parameter names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString
.