You are here

function syntaxhighlighter_filter in Syntax Highlighter 6

Same name and namespace in other branches
  1. 6.2 syntaxhighlighter.module \syntaxhighlighter_filter()

Implements hook_filter()

File

./syntaxhighlighter.module, line 156
Syntax highlight code using the Syntaxhighlighter javascript library. See http://alexgorbatchev.com/wiki/SyntaxHighlighter

Code

function syntaxhighlighter_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(
        0 => t('Syntax highlighter'),
      );
    case 'description':
      return syntaxhighlighter_filter_tips(0, 0, FALSE);
    case 'no cache':
      return FALSE;
    case 'prepare':
      if ($delta == 0) {
        return _syntaxhighlighter_do_filter_prepare($text);
      }
      else {
        return $text;
      }
    case 'process':
      if ($delta == 0) {
        return _syntaxhighlighter_do_filter_process($text);
      }
      else {
        return $text;
      }

    // do nothing
    default:
      return $text;
  }
}