Mission accomplished
Thanks Bob, Susan
Bob this is dedicated to you
Made out of your "FixedPre" Add-On with some modification according to your instructions.
<?php
switch ($modx->event->name) {
case 'OnParseDocument':
if (! function_exists('quote_meta') ) {
function quote_meta($a) {
$lhs = array("[", "]");
$rhs = array("091X2", "092X2");
$b = str_replace("&", "\46", $a[2]); //save "&"
$lhs_preg = array('|<!(!*)notag>|', '|<!(!*)/notag>|');
$rhs_preg = array('<$1notag>', '<$1/notag>');
$b = preg_replace($lhs_preg, $rhs_preg, $b);
$b = str_replace($lhs, $rhs, $b);
return str_replace("\46", "093X", $b);
}
}
$output =& $modx->documentOutput;
$output = preg_replace_callback("#(<notag>)(.*?)(</notag>)#s", "quote_meta", $output);
break;
case 'OnWebPagePrerender':
$output = &$modx->resource->_output; // get a reference to the output
$output = str_replace('091X2','[',$output);
$output = str_replace('092X2',']',$output);
$output = str_replace('093X','&',$output);
break;
}
However, still not passing all files, some files are now returned blank. The best option is to have a feature request to have a special tag like the comment, but for not processing any symbols or brackets.