update genshi to 1.0.8.11

This commit is contained in:
XhmikosR 2012-09-19 21:09:59 +03:00 committed by PKEuS
parent 9cbeb3f4a1
commit a30d49a919
3 changed files with 46 additions and 26 deletions

View File

@ -41,7 +41,7 @@
//
/** The version of this GeSHi file */
define('GESHI_VERSION', '1.0.8.10');
define('GESHI_VERSION', '1.0.8.11');
// Define the root directory for the GeSHi code tree
if (!defined('GESHI_ROOT')) {
@ -604,6 +604,17 @@ class GeSHi {
$this->set_language_path($path);
}
/**
* Returns the version of GeSHi
*
* @return string
* @since 1 0.8.11
*/
function get_version()
{
return GESHI_VERSION;
}
/**
* Returns an error message associated with the last GeSHi operation,
* or false if no error has occured
@ -808,7 +819,7 @@ class GeSHi {
}
// match the langname
if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+)\'/', $data, $matches)) {
if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+?)\'/', $data, $matches)) {
$this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language);
return false;
}
@ -1437,6 +1448,8 @@ class GeSHi {
* @todo static?
*/
function get_language_name_from_extension( $extension, $lookup = array() ) {
$extension = strtolower($extension);
if ( !is_array($lookup) || empty($lookup)) {
$lookup = array(
'6502acme' => array( 'a', 's', 'asm', 'inc' ),
@ -1470,6 +1483,7 @@ class GeSHi {
'gnuplot' => array('plt'),
'groovy' => array('groovy'),
'haskell' => array('hs'),
'haxe' => array('hx'),
'html4strict' => array('html', 'htm'),
'ini' => array('ini', 'desktop'),
'java' => array('java'),
@ -1504,6 +1518,7 @@ class GeSHi {
'smalltalk' => array('st'),
'smarty' => array(),
'tcl' => array('tcl'),
'text' => array('txt'),
'vb' => array('bas'),
'vbnet' => array(),
'visualfoxpro' => array(),
@ -1518,7 +1533,8 @@ class GeSHi {
return $lang;
}
}
return '';
return 'text';
}
/**
@ -1555,6 +1571,9 @@ class GeSHi {
* @since 1.0.0
*/
function add_keyword($key, $word) {
if (!is_array($this->language_data['KEYWORDS'][$key])) {
$this->language_data['KEYWORDS'][$key] = array();
}
if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
$this->language_data['KEYWORDS'][$key][] = $word;
@ -3231,6 +3250,7 @@ class GeSHi {
function handle_keyword_replace($match) {
$k = $this->_kw_replace_group;
$keyword = $match[0];
$keyword_match = $match[1];
$before = '';
$after = '';
@ -3248,12 +3268,12 @@ class GeSHi {
if (!$this->language_data['CASE_SENSITIVE'][$k] &&
strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) {
foreach ($this->language_data['KEYWORDS'][$k] as $word) {
if (strcasecmp($word, $keyword) == 0) {
if (strcasecmp($word, $keyword_match) == 0) {
break;
}
}
} else {
$word = $keyword;
$word = $keyword_match;
}
$before = '<|UR1|"' .

View File

@ -7,7 +7,7 @@
* - Jack Lloyd (lloyd@randombit.net)
* - Michael Mol (mikemol@gmail.com)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
* Release Version: 1.0.8.10
* Release Version: 1.0.8.11
* Date Started: 2004/06/04
*
* C language file for GeSHi.

View File

@ -7,7 +7,7 @@
* - M. Uli Kusterer (witness.of.teachtext@gmx.net)
* - Jack Lloyd (lloyd@randombit.net)
* Copyright: (c) 2004 Dennis Bayer, Nigel McNie (http://qbnz.com/highlighter)
* Release Version: 1.0.8.10
* Release Version: 1.0.8.11
* Date Started: 2004/09/27
*
* C++ language file for GeSHi.