', '', $code);
$id = 'codebox' . ++$code_count;
$boxid = " id=\"$id\" ";
$out = $code;
if (isset($colors)) {
if ($colors == '1') {
// remove old geshi setting as it upsets codemirror
unset($colors);
} else {
// codemirror expects language names in lower case
$colors = strtolower($colors);
}
}
// respect wrap parameter when Codemirror is off and line wrap when Codemirror is on to avoid broken view while JavaScript loads.
if ((isset($prefs['feature_syntax_highlighter']) && $prefs['feature_syntax_highlighter'] == 'y') || $wrap == 1) {
$pre_style = 'white-space:pre-wrap;'
// If needed, break words
. ' overflow-wrap: break-word;' // CSS 3 working draft
. ' word-wrap: break-word;'; // Original proprietary Microsoft name
if (! isset($theme) && isset($prefs['feature_syntax_highlighter_theme'])) {
$theme = $prefs['feature_syntax_highlighter_theme'];
}
}
$out = (isset($caption) ? '' . $caption . '
' : "" )
. ''
. (TikiLib::lib('parser')->option['ck_editor'] || $ishtml ? $out : htmlentities($out, ENT_QUOTES, 'UTF-8'))
. '';
return $out;
}