// First, remove all tab/new-line/revert characters
$compactedContent = str_replace(chr(9), '', str_replace(PHP_EOL, '', str_replace(chr(13), '', $uncompactedContent)));
+ // Make a space after >
+ $compactedContent = str_replace(array('>', ' '), array('> ', ' '), $compactedContent);
+
// Then regex all comments like <!-- //--> away
preg_match_all('/<!--[\w\W]*?(\/\/){0,1}-->/', $compactedContent, $matches);
} // END - foreach
} // END - if
- // Set the content again
- // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
-
// Return compacted content
return $compactedContent;
}