You are here

function _codefilter_escape_code_tag_callback in Code Filter 7

Callback to escape content of <code> elements.

File

./codefilter.module, line 133
Text filter for highlighting PHP source code.

Code

function _codefilter_escape_code_tag_callback($matches) {

  // Extract a potentially existing class HTML attribute.
  $attributes = NULL;
  if (!empty($matches[1]) && preg_match('@class="[^"]+"@', $matches[1], $class_matches)) {
    $attributes = $class_matches[0];
  }
  return codefilter_escape($matches[2], 'code', $attributes);
}