| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function parse($path) { |
||
| 20 | if (!strpos($path, '.md')) { |
||
| 21 | $path .= '.md'; |
||
| 22 | } |
||
| 23 | |||
| 24 | $root = Config::get('directories.src'); |
||
| 25 | $files = Finder::create()->files()->in($root)->path($path)->getIterator(); |
||
| 26 | $files->rewind(); |
||
| 27 | $markdownFile = $files->current(); |
||
| 28 | |||
| 29 | if (!$markdownFile) { |
||
| 30 | return ''; |
||
| 31 | } |
||
| 32 | |||
| 33 | $html = Parsedown::instance()->parse($markdownFile->getContents()); |
||
| 34 | |||
| 35 | return $html; |
||
| 36 | } |
||
| 37 | |||
| 39 |