function _codefilter_prism_escape_code_tag_callback in Code Filter 7
Callback to escape content of <code> elements.
File
- modules/
codefilter_prism/ codefilter_prism.module, line 160 - Text filter for highlighting PHP source code.
Code
function _codefilter_prism_escape_code_tag_callback($matches) {
// Extract a potentially existing class HTML attribute.
$attributes = '';
if (!empty($matches[1]) && preg_match('@class="[^"]+"@', $matches[1], $class_matches)) {
$attributes = $class_matches[0];
}
return codefilter_prism_escape($matches[2], 'code', $attributes);
}