© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group

<?php
function replace_modxtags($matches){
global $modx;
$code_entities_match = array('[', ']','[[', ']]');
$code_entities_replace = array(
'<span class="bracket">[</span>',
'<span class="bracket">]</span>',
'<span class="bracket">[[</span>',
'<span class="bracket">]]</span>',
);
$code = str_replace($code_entities_match,$code_entities_replace,$matches[1]);
return '<pre>'.$code.'</pre>';
}
$modx->documentObject['content']=preg_replace_callback("#<pre>(.*?)</pre>#s", "replace_modxtags", $modx->documentObject['content']);<pre><code>ваш код