public static function clean($str, $allow_email=false)
    {

        $str = self::typoFix($str);

        $str = \sb\String\HTML::escape($str);

        $str = self::convertQuotes($str);

        $str = self::listsToHtml($str);

        $str = self::tablesToHtml($str);

        $str = self::linksToHtml($str, $allow_email);

        $str = self::colorizeInstantMessages($str);

        $str = self::textStyles($str);

        $str = self::parseCss($str);

        $str = self::addSearches($str);

        $str = self::miscTags($str);

        //turn any tabs into 4 spaces
        $str = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;", $str);

        return $str;
    }