You are here

function geshinode_view in GeSHi Filter for syntax highlighting 5.2

Same name and namespace in other branches
  1. 6 geshinode.module \geshinode_view()

Implementation of hook_view()

File

./geshinode.module, line 140

Code

function geshinode_view($node, $teaser = FALSE, $page = FALSE) {
  require_once './' . drupal_get_path('module', 'geshifilter') . '/geshifilter.pages.inc';
  $node->readmore = strlen($node->teaser) < strlen($node->body);
  $line_numbering = variable_get('geshinode_line_numbering', GESHIFILTER_LINE_NUMBERS_DEFAULT_NONE);
  $source_code = $teaser ? $node->teaser : $node->body;
  $node->content['body'] = array(
    '#value' => geshifilter_process($source_code, $node->language, $line_numbering),
    '#weight' => 0,
  );
  return $node;
}