Ejemplo n.º 1
0
 private function replace_with_geshi($matches)
 {
     $params = $this->getParams(strtolower($matches[1]));
     $code = trim($matches[2]);
     $lang = $params['lang'];
     $geshi = new geshi($code, isset($lang) ? $lang : "");
     $geshi->enable_classes(false);
     $geshi->set_overall_id('geshi_code');
     if (isset($params['title'])) {
         $geshi->highlight_lines_extra(array($params['title']));
     }
     $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
     $geshi->set_tab_width(3);
     $geshi->set_header_type(GESHI_HEADER_DIV);
     $code = "<div class=\"kodrs\">" . @$geshi->parse_code() . "</div>";
     return $code;
 }
Ejemplo n.º 2
0
 private function replace_with_geshi($matches)
 {
     $lang = strtolower($matches[1]);
     $code = trim($matches[2]);
     $geshi = new geshi($code, isset($lang) ? $lang : "");
     $geshi->enable_classes(false);
     $geshi->set_overall_id('geshi_code');
     return @$geshi->parse_code();
 }