| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | protected function _parse($content, $attributes, \JBBCode\ElementNode $node) |
||
| 26 | { |
||
| 27 | $type = 'text'; |
||
| 28 | if (!empty($attributes['code'])) { |
||
| 29 | $type = $attributes['code']; |
||
| 30 | } |
||
| 31 | |||
| 32 | $this->Geshi->defaultLanguage = 'text'; |
||
|
|
|||
| 33 | // allow all languages |
||
| 34 | $this->Geshi->validLanguages = [true]; |
||
| 35 | // load config from app/Config/geshi.php |
||
| 36 | $this->Geshi->features = false; |
||
| 37 | |||
| 38 | $string = '<div class="geshi-wrapper"><pre lang="' . $type . '">' . $content . '</pre></div>'; |
||
| 39 | |||
| 40 | $string = $this->Geshi->highlight($string); |
||
| 41 | |||
| 42 | return $string; |
||
| 43 | } |
||
| 52 |