Text_Highlighter_Renderer_Array::preprocess PHP Method

preprocess() public method

Preprocesses code
public preprocess ( string $str ) : string
$str string Code to preprocess
return string Preprocessed code
    function preprocess($str)
    {
        // normalize whitespace and tabs
        $str = str_replace("\r\n", "\n", $str);
        $str = str_replace("\r", "\n", $str);
        // some browsers refuse to display empty lines
        $str = preg_replace('~^$~m', " ", $str);
        $str = str_replace("\t", str_repeat(' ', $this->_tabsize), $str);
        return rtrim($str);
    }