Possible to use CodeIgniter output compression with <pre> to display code blocks?
Is it possible to exclude `<pre>` tags from this code igniter compression hook?  I don't understand regular expressions well enough to not break my page.  I have tried, but it always jacks up the output.

I'm trying to show code examples in a compressed output page.

    <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    function compress()
    {
    	$CI =& get_instance();
    	$buffer = $CI->output->get_output();
    
    	 $search = array(
    		'/\n/',
    		'/\>[^\S ]+/s',
    		'/[^\S ]+\</s',
    	 	'/(\s)+/s'
    	  );
    
    	 $replace = array(
    		' ',
    		'>',
    	 	'<',
    	 	'\\1'
    	  );
    
    	$buffer = preg_replace($search, $replace, $buffer);
    
    	$CI->output->set_output($buffer);
    	$CI->output->_display();
    }
    
    ?>
Possible to use CodeIgniter output compression with <pre> to display code blocks?
===

Is it possible to exclude `<pre>` tags from this code igniter compression hook?  I don't understand regular expressions well enough to not break my page.  I have tried, but it always jacks up the output.

I'm trying to show code examples in a compressed output page.

    <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    function compress()
    {
    	$CI =& get_instance();
    	$buffer = $CI->output->get_output();
    
    	 $search = array(
    		'/\n/',
    		'/\>[^\S ]+/s',
    		'/[^\S ]+\</s',
    	 	'/(\s)+/s'
    	  );
    
    	 $replace = array(
    		' ',
    		'>',
    	 	'<',
    	 	'\\1'
    	  );
    
    	$buffer = preg_replace($search, $replace, $buffer);
    
    	$CI->output->set_output($buffer);
    	$CI->output->_display();
    }
    
    ?>