Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function parse($path) { |
||
35 | if (!strpos($path, '.md')) { |
||
36 | $path .= '.md'; |
||
37 | } |
||
38 | |||
39 | $files = Finder::create()->files()->in($this->srcDir)->path($path)->getIterator(); |
||
40 | $files->rewind(); |
||
41 | $markdownFile = $files->current(); |
||
42 | |||
43 | if (!$markdownFile) { |
||
44 | return ''; |
||
45 | } |
||
46 | |||
47 | $html = Parsedown::instance()->parse($markdownFile->getContents()); |
||
48 | |||
49 | return $html; |
||
50 | } |
||
51 | |||
53 |