echo "[~1~]";
echo $modx->makeUrl(1);
$in = '!\[\~([0-9]+)\~\]!ise'; // Use preg_replace with /e to make it evaluate PHP
$out = "\$modx->makeUrl(" . '\\1' . "')";
$modx->documentOutput = preg_replace($in, $out, $modx->documentOutput);
I’ve found that in MODx 0.9.6.3 DocumentParser class function RewriteUrls() doesn’t call $this->MakeUrl(), but does the same work itself.
Result is unexpected for me, because MakeUrl() inserts $config[’base_url’] in the path, but RewriteUrls does not.