_texto = $matches[2]; $lang = ( preg_match( self::REGEX_LANG, $tag, $attrLang, PREG_OFFSET_CAPTURE ) ) ? $attrLang[1][0] : 'php'; $lines = ( preg_match( self::REGEX_LINES, $tag, $attrLines, PREG_OFFSET_CAPTURE ) ) ? (string) $attrLines[1][0] : 'false'; $html_entities_match = array( "|\
|", "#<#", "#>#", "|'|", '#"#', '# #' ); $html_entities_replace = array( "\n", '<', '>', "'", '"', ' ' ); $this->_texto = preg_replace( $html_entities_match, $html_entities_replace, $this->_texto ); $this->_texto = str_replace('<', '<', $this->_texto); $this->_texto = str_replace('>', '>', $this->_texto); $this->_texto = str_replace(" ", "  ", $this->_texto); $this->_texto = str_replace(" ", "  ", $this->_texto); $this->_texto = str_replace("\t", "   ", $this->_texto); $this->_texto = str_replace( "\t", ' ', $this->_texto ); require_once('./extensions/ext_geshi/geshi/geshi.php'); $geshi = new GeSHi( $this->_texto, $lang ); if ( (string) $lines == 'true') { $geshi->enable_line_numbers( GESHI_NORMAL_LINE_NUMBERS ); } $text = $geshi->parse_code(); return $text; } }