function _syntaxhighlighter_replace in Syntax Highlighter 6
Same name and namespace in other branches
- 7 syntaxhighlighter.module \_syntaxhighlighter_replace()
Escape " to ' in OPTIONS string
File
- ./
syntaxhighlighter.module, line 304 - 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}\">";
}
}