$e = &$modx->Event; switch ($e->name) { case 'OnParseDocument': $replace = array( '<p>[!' => '[!', '!]</p>' => '!]', '<p>[*' => '[*', '*]</p>' => '*]', '<p>[[' => '[[', ']]</p>' => ']]', '<p>{{' => '{{', '}}</p>' => '}}' ); $this->documentOutput = str_replace(array_keys($replace), array_values($replace), $this->documentOutput); break; default: ''; return; }