BLOCK::2
"
* so look for those place holders and replace
* them with the original blocks */
if (preg_match_all('/BLOCK::(\d+)<\/code>/', $eventData[$element], $matches )) {
foreach($matches[1] as $key=>$match) {
$eventData[$element] = str_replace($matches[0][$key], $blocks[$match], $eventData[$element]);
}
}
/* post-process each block */
foreach($preserve_tags as $tag) {
$method = '_process_tag_' . $tag;
if (method_exists($this,$method)) {
if (preg_match_all('/<'.$tag.'[^>]?>(.*)<\/'.$tag.'>/msU', $eventData[$element], $matches )) {
foreach($matches[1] as $key=>$match) {
$eventData[$element] = str_replace($matches[0][$key], $this->$method($match), $eventData[$element]);
}
}
}
}
/* end textile processing */
}
}
return true;
case 'frontend_comment':
if (serendipity_db_bool($this->get_config('COMMENT', true))) {
echo '' . PLUGIN_EVENT_TEXTILE_TRANSFORM . '';
}
return true;
break;
default:
return false;
}
} else {
return false;
}
}
function _process_tag_php($text) {
$code = "";
# Using OB, as highlight_string() only supports
# returning the result from 4.2.0
ob_start();
highlight_string($code);
$highlighted = ob_get_contents();
ob_end_clean();
# Fix output to use CSS classes and wrap well
$highlighted = '