You are here

function _syntaxhighlighter_replace in Syntax Highlighter 7

Same name and namespace in other branches
  1. 6 syntaxhighlighter.module \_syntaxhighlighter_replace()

Escape " to ' in OPTIONS string

File

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

Code

function _syntaxhighlighter_replace($x) {
  $x = strtr($x, array(
    '\\"' => "'",
  ));
  $tag_name = variable_get('syntaxhighlighter_tagname', 'pre');
  if (_syntaxhighlighter_string_begins_with($x, 'class') || _syntaxhighlighter_string_begins_with($x, 'title')) {
    return "<{$tag_name} {$x}>";
  }
  else {
    return "<{$tag_name} class=\"{$x}\">";
  }
}