on the line).
+ // So the source output looks like this:
+ //
+ //
+ //
+
+
+
GeSHi examples
+
+
+
+
GeSHi Example Script
+
To use this script, make sure that geshi.php is in the parent directory or in your
+include_path, and that the language files are in a subdirectory of GeSHi's directory called geshi/.
+
Enter your source and a language to highlight the source in and submit, or just choose a language to
+have that language file highlighted in PHP.
+parse_code();
+ echo '
';
+}
+?>
+
+
+
+
diff --git a/plugins/codesnippetgeshi/dev/geshi/contrib/langcheck.php b/plugins/codesnippetgeshi/dev/geshi/contrib/langcheck.php
new file mode 100644
index 00000000000..fa8288beaae
--- /dev/null
+++ b/plugins/codesnippetgeshi/dev/geshi/contrib/langcheck.php
@@ -0,0 +1,769 @@
+';
+ $colors = array(
+ TYPE_NOTICE => '
',
+ TYPE_WARNING => '',
+ TYPE_ERROR => '',
+ TYPE_OK => ''
+ );
+ } else {
+ $end = chr(27).'[0m';
+ $colors = array(
+ TYPE_NOTICE => chr(27).'[1m',
+ TYPE_WARNING => chr(27).'[1;33m',
+ TYPE_ERROR => chr(27).'[1;31m',
+ TYPE_OK => chr(27).'[1;32m'
+ );
+ }
+ }
+
+ if ( !isset($colors[$level]) ) {
+ trigger_error("no colors for level $level", E_USER_ERROR);
+ }
+
+ return $colors[$level].$string.$end;
+}
+
+define ('TYPE_NOTICE', 0);
+define ('TYPE_WARNING', 1);
+define ('TYPE_ERROR', 2);
+define ('TYPE_OK', 3);
+
+$error_abort = false;
+$error_cache = array();
+function output_error_cache(){
+ global $error_cache, $error_abort;
+
+ if(count($error_cache)) {
+ echo colorize(TYPE_ERROR, "Failed");
+ if ( PHP_SAPI == 'cli' ) {
+ echo "\n\n";
+ } else {
+ echo "
\n";
+ }
+ foreach($error_cache as $error_msg) {
+ if ( PHP_SAPI == 'cli' ) {
+ echo "\n";
+ } else {
+ echo "- ";
+ }
+ switch($error_msg['t']) {
+ case TYPE_NOTICE:
+ $msg = 'NOTICE';
+ break;
+ case TYPE_WARNING:
+ $msg = 'WARNING';
+ break;
+ case TYPE_ERROR:
+ $msg = 'ERROR';
+ break;
+ }
+ echo colorize($error_msg['t'], $msg);
+ if ( PHP_SAPI == 'cli' ) {
+ echo "\t" . $error_msg['m'];
+ } else {
+ echo " " . $error_msg['m'] . "
";
+ }
+ }
+ if ( PHP_SAPI == 'cli' ) {
+ echo "\n";
+ } else {
+ echo "
\n";
+ }
+ } else {
+ echo colorize(TYPE_OK, "OK");
+ if ( PHP_SAPI == 'cli' ) {
+ echo "\n";
+ } else {
+ echo "\n
";
+ }
+ }
+ echo "\n";
+
+ $error_cache = array();
+}
+
+function report_error($type, $message) {
+ global $error_cache, $error_abort;
+
+ $error_cache[] = array('t' => $type, 'm' => $message);
+ if(TYPE_ERROR == $type) {
+ $error_abort = true;
+ }
+}
+
+function dupfind_strtolower(&$value){
+ $value = strtolower($value);
+}
+
+if ( PHP_SAPI != 'cli' ) { ?>
+
+
+
+ GeSHi Language File Validation Script
+
+
+
+GeSHi Language File Validation Script
+To use this script, make sure that geshi.php is in the
+parent directory or in your include_path, and that the language files are in a
+subdirectory of GeSHi's directory called geshi/.
+Everything else will be done by this script automatically. After the script
+finished you should see messages of what could cause trouble with GeSHi or where
+your language files can be improved. Please be patient, as this might take some time.
+
+
+- Checking where to find GeSHi installation ...
+
+
+
+To use this script, make sure that is in the
+parent directory or in your include_path, and that the language files are in a
+subdirectory of GeSHi's directory called .
+
+Everything else will be done by this script automatically. After the script
+finished you should see messages of what could cause trouble with GeSHi or where
+your language files can be improved. Please be patient, as this might take some time.
+
+
+Checking where to find GeSHi installation ...\n
- Listing available language files ... ";
+ }
+
+ if (!($dir = @opendir(GESHI_LANG_ROOT))) {
+ report_error(TYPE_ERROR, 'Error requesting listing for available language files!');
+ }
+
+ $languages = array();
+
+ if(!$error_abort) {
+ while ($file = readdir($dir)) {
+ if (!$file || $file[0] == '.' || strpos($file, '.php') === false) {
+ continue;
+ }
+ $lang = substr($file, 0, strpos($file, '.'));
+ if(4 != strlen($file) - strlen($lang)) {
+ continue;
+ }
+ $languages[] = $lang;
+ }
+ closedir($dir);
+ }
+
+ $languages = array_unique($languages);
+ sort($languages);
+
+ if(!count($languages)) {
+ report_error(TYPE_WARNING, 'Unable to locate any usable language files in "'.GESHI_LANG_ROOT.'"!');
+ }
+
+ output_error_cache();
+}
+
+if ( PHP_SAPI == 'cli' ) {
+ if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $languages)) {
+ $languages = array($_SERVER['argv'][1]);
+ }
+} else {
+ if (isset($_REQUEST['show']) && in_array($_REQUEST['show'], $languages)) {
+ $languages = array($_REQUEST['show']);
+ }
+}
+
+if(!$error_abort) {
+ foreach ($languages as $lang) {
+
+ if ( PHP_SAPI == 'cli' ) {
+ echo "Validating language file for '$lang' ...\t\t";
+ } else {
+ echo "
\n- Validating language file for '$lang' ... ";
+ }
+
+ $langfile = GESHI_LANG_ROOT . $lang . '.php';
+
+ $language_data = array();
+
+ if(!is_file($langfile)) {
+ report_error(TYPE_ERROR, 'The path "' .$langfile. '" does not ressemble a regular file!');
+ } elseif(!is_readable($langfile)) {
+ report_error(TYPE_ERROR, 'Cannot read file "' .$langfile. '"!');
+ } else {
+ $langfile_content = file_get_contents($langfile);
+ if(preg_match("/\?>(?:\r?\n|\r(?!\n)){2,}\Z/", $langfile_content)) {
+ report_error(TYPE_ERROR, 'Language file contains trailing empty lines at EOF!');
+ }
+ if(!preg_match("/\?>(?:\r?\n|\r(?!\n))?\Z/", $langfile_content)) {
+ report_error(TYPE_ERROR, 'Language file contains no PHP end marker at EOF!');
+ }
+ if(preg_match("/\t/", $langfile_content)) {
+ report_error(TYPE_NOTICE, 'Language file contains unescaped tabulator chars (probably for indentation)!');
+ }
+ if(preg_match('/^(?: )*(?! )(?! \*) /m', $langfile_content)) {
+ report_error(TYPE_NOTICE, 'Language file contains irregular indentation (other than 4 spaces per indentation level)!');
+ }
+
+ if(!preg_match("/\/\*\*((?!\*\/).)*?Author:((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not contain a specification of an author!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?Copyright:((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not contain a specification of the copyright!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?Release Version:((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not contain a specification of the release version!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?Date Started:((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not contain a specification of the date it was started!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?This file is part of GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not state that it belongs to GeSHi!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?language file for GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not state that it is a language file for GeSHi!');
+ }
+ if(!preg_match("/\/\*\*((?!\*\/).)*?GNU General Public License((?!\*\/).)*?\*\//s", $langfile_content)) {
+ report_error(TYPE_WARNING, 'Language file does not state that it is provided under the terms of the GNU GPL!');
+ }
+
+ unset($langfile_content);
+
+ include $langfile;
+
+ if(!isset($language_data)) {
+ report_error(TYPE_ERROR, 'Language file does not contain a $language_data structure to check!');
+ } elseif (!is_array($language_data)) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data structure which is not an array!');
+ }
+ }
+
+ if(!$error_abort) {
+ if(!isset($language_data['LANG_NAME'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'LANG_NAME\'] specification!');
+ } elseif (!is_string($language_data['LANG_NAME'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'LANG_NAME\'] specification which is not a string!');
+ }
+
+ if(!isset($language_data['COMMENT_SINGLE'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_SIGNLE\'] structure to check!');
+ } elseif (!is_array($language_data['COMMENT_SINGLE'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_SINGLE\'] structure which is not an array!');
+ }
+
+ if(!isset($language_data['COMMENT_MULTI'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_MULTI\'] structure to check!');
+ } elseif (!is_array($language_data['COMMENT_MULTI'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_MULTI\'] structure which is not an array!');
+ }
+
+ if(isset($language_data['COMMENT_REGEXP'])) {
+ if (!is_array($language_data['COMMENT_REGEXP'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_REGEXP\'] structure which is not an array!');
+ }
+ }
+
+ if(!isset($language_data['QUOTEMARKS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'QUOTEMARKS\'] structure to check!');
+ } elseif (!is_array($language_data['QUOTEMARKS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'QUOTEMARKS\'] structure which is not an array!');
+ }
+
+ if(isset($language_data['HARDQUOTE'])) {
+ if (!is_array($language_data['HARDQUOTE'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HARDQUOTE\'] structure which is not an array!');
+ }
+ }
+
+ if(!isset($language_data['ESCAPE_CHAR'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'ESCAPE_CHAR\'] specification to check!');
+ } elseif (!is_string($language_data['ESCAPE_CHAR'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification which is not a string!');
+ } elseif (1 < strlen($language_data['ESCAPE_CHAR'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification is not empty or exactly one char!');
+ }
+
+ if(!isset($language_data['CASE_KEYWORDS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_KEYWORDS\'] specification!');
+ } elseif (!is_int($language_data['CASE_KEYWORDS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is not an integer!');
+ } elseif (GESHI_CAPS_NO_CHANGE != $language_data['CASE_KEYWORDS'] &&
+ GESHI_CAPS_LOWER != $language_data['CASE_KEYWORDS'] &&
+ GESHI_CAPS_UPPER != $language_data['CASE_KEYWORDS']) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is neither of GESHI_CAPS_NO_CHANGE, GESHI_CAPS_LOWER nor GESHI_CAPS_UPPER!');
+ }
+
+ if(!isset($language_data['KEYWORDS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'KEYWORDS\'] structure to check!');
+ } elseif (!is_array($language_data['KEYWORDS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'KEYWORDS\'] structure which is not an array!');
+ } else {
+ foreach($language_data['KEYWORDS'] as $kw_key => $kw_value) {
+ if(!is_integer($kw_key)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$kw_key' in \$language_data['KEYWORDS'] that is not integer!");
+ } elseif (!is_array($kw_value)) {
+ report_error(TYPE_ERROR, "Language file contains a \$language_data['KEYWORDS']['$kw_value'] structure which is not an array!");
+ }
+ }
+ }
+
+ if(!isset($language_data['SYMBOLS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SYMBOLS\'] structure to check!');
+ } elseif (!is_array($language_data['SYMBOLS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SYMBOLS\'] structure which is not an array!');
+ }
+
+ if(!isset($language_data['CASE_SENSITIVE'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_SENSITIVE\'] structure to check!');
+ } elseif (!is_array($language_data['CASE_SENSITIVE'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_SENSITIVE\'] structure which is not an array!');
+ } else {
+ foreach($language_data['CASE_SENSITIVE'] as $cs_key => $cs_value) {
+ if(!is_integer($cs_key)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$cs_key' in \$language_data['CASE_SENSITIVE'] that is not integer!");
+ } elseif (!is_bool($cs_value)) {
+ report_error(TYPE_ERROR, "Language file contains a Case Sensitivity specification for \$language_data['CASE_SENSITIVE']['$cs_value'] which is not a boolean!");
+ }
+ }
+ }
+
+ if(!isset($language_data['URLS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'URLS\'] structure to check!');
+ } elseif (!is_array($language_data['URLS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'URLS\'] structure which is not an array!');
+ } else {
+ foreach($language_data['URLS'] as $url_key => $url_value) {
+ if(!is_integer($url_key)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$url_key' in \$language_data['URLS'] that is not integer!");
+ } elseif (!is_string($url_value)) {
+ report_error(TYPE_ERROR, "Language file contains a Documentation URL specification for \$language_data['URLS']['$url_value'] which is not a string!");
+ } elseif (preg_match('#&([^;]*(=|$))#U', $url_value)) {
+ report_error(TYPE_ERROR, "Language file contains unescaped ampersands (&) in \$language_data['URLS']!");
+ }
+ }
+ }
+
+ if(!isset($language_data['OOLANG'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OOLANG\'] specification!');
+ } elseif (!is_int($language_data['OOLANG']) && !is_bool($language_data['OOLANG'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither boolean nor integer!');
+ } elseif (false !== $language_data['OOLANG'] &&
+ true !== $language_data['OOLANG'] &&
+ 2 !== $language_data['OOLANG']) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither of false, true or 2!');
+ }
+
+ if(!isset($language_data['OBJECT_SPLITTERS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OBJECT_SPLITTERS\'] structure to check!');
+ } elseif (!is_array($language_data['OBJECT_SPLITTERS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OBJECT_SPLITTERS\'] structure which is not an array!');
+ }
+
+ if(!isset($language_data['REGEXPS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'REGEXPS\'] structure to check!');
+ } elseif (!is_array($language_data['REGEXPS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'REGEXPS\'] structure which is not an array!');
+ }
+
+ if(!isset($language_data['STRICT_MODE_APPLIES'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STRICT_MODE_APPLIES\'] specification!');
+ } elseif (!is_int($language_data['STRICT_MODE_APPLIES'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is not an integer!');
+ } elseif (GESHI_MAYBE != $language_data['STRICT_MODE_APPLIES'] &&
+ GESHI_ALWAYS != $language_data['STRICT_MODE_APPLIES'] &&
+ GESHI_NEVER != $language_data['STRICT_MODE_APPLIES']) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is neither of GESHI_MAYBE, GESHI_ALWAYS nor GESHI_NEVER!');
+ }
+
+ if(!isset($language_data['SCRIPT_DELIMITERS'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SCRIPT_DELIMITERS\'] structure to check!');
+ } elseif (!is_array($language_data['SCRIPT_DELIMITERS'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SCRIPT_DELIMITERS\'] structure which is not an array!');
+ }
+
+ if(!isset($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure to check!');
+ } elseif (!is_array($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure which is not an array!');
+ }
+
+ if(isset($language_data['TAB_WIDTH'])) {
+ if (!is_int($language_data['TAB_WIDTH'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is not an integer!');
+ } elseif (1 > $language_data['TAB_WIDTH']) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is less than 1!');
+ }
+ }
+
+ if(isset($language_data['PARSER_CONTROL'])) {
+ if (!is_array($language_data['PARSER_CONTROL'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'PARSER_CONTROL\'] structure which is not an array!');
+ }
+ }
+
+ if(!isset($language_data['STYLES'])) {
+ report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STYLES\'] structure to check!');
+ } elseif (!is_array($language_data['STYLES'])) {
+ report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STYLES\'] structure which is not an array!');
+ } else {
+ $style_arrays = array('KEYWORDS', 'COMMENTS', 'ESCAPE_CHAR',
+ 'BRACKETS', 'STRINGS', 'NUMBERS', 'METHODS', 'SYMBOLS',
+ 'REGEXPS', 'SCRIPT');
+ foreach($style_arrays as $style_kind) {
+ if(!isset($language_data['STYLES'][$style_kind])) {
+ report_error(TYPE_ERROR, "Language file contains no \$language_data['STYLES']['$style_kind'] structure to check!");
+ } elseif (!is_array($language_data['STYLES'][$style_kind])) {
+ report_error(TYPE_ERROR, "Language file contains a \$language_data['STYLES\']['$style_kind'] structure which is not an array!");
+ } else {
+ foreach($language_data['STYLES'][$style_kind] as $sk_key => $sk_value) {
+ if(!is_int($sk_key) && ('COMMENTS' != $style_kind && 'MULTI' != $sk_key)
+ && !(('STRINGS' == $style_kind || 'ESCAPE_CHAR' == $style_kind) && 'HARD' == $sk_key)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$sk_key' in \$language_data['STYLES']['$style_kind'] that is not integer!");
+ } elseif (!is_string($sk_value)) {
+ report_error(TYPE_WARNING, "Language file contains a CSS specification for \$language_data['STYLES']['$style_kind'][$key] which is not a string!");
+ }
+ }
+ }
+ }
+
+ unset($style_arrays);
+ }
+ }
+
+ if(!$error_abort) {
+ //Initial sanity checks survived? --> Let's dig deeper!
+ foreach($language_data['KEYWORDS'] as $key => $keywords) {
+ if(!isset($language_data['CASE_SENSITIVE'][$key])) {
+ report_error(TYPE_ERROR, "Language file contains no \$language_data['CASE_SENSITIVE'] specification for keyword group $key!");
+ }
+ if(!isset($language_data['URLS'][$key])) {
+ report_error(TYPE_ERROR, "Language file contains no \$language_data['URLS'] specification for keyword group $key!");
+ }
+ if(empty($keywords)) {
+ report_error(TYPE_WARNING, "Language file contains an empty keyword list in \$language_data['KEYWORDS'] for group $key!");
+ }
+ foreach($keywords as $id => $kw) {
+ if(!is_string($kw)) {
+ report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['KEYWORDS'][$key][$id]!");
+ } elseif (!strlen($kw)) {
+ report_error(TYPE_ERROR, "Language file contains an empty string entry at \$language_data['KEYWORDS'][$key][$id]!");
+ } elseif (preg_match('/^([\(\)\{\}\[\]\^=.,:;\-+\*\/%\$\"\'\?]|&[\w#]\w*;)+$/i', $kw)) {
+ report_error(TYPE_NOTICE, "Language file contains an keyword ('$kw') at \$language_data['KEYWORDS'][$key][$id] which seems to be better suited for the symbols section!");
+ }
+ }
+ if(isset($language_data['CASE_SENSITIVE'][$key]) && !$language_data['CASE_SENSITIVE'][$key]) {
+ array_walk($keywords, 'dupfind_strtolower');
+ }
+ if(count($keywords) != count(array_unique($keywords))) {
+ $kw_diffs = array_count_values($keywords);
+ foreach($kw_diffs as $kw => $kw_count) {
+ if($kw_count > 1) {
+ report_error(TYPE_WARNING, "Language file contains per-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key]!");
+ }
+ }
+ }
+ }
+
+ $disallowed_before = "(?|^&";
+ $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
+
+ foreach($language_data['KEYWORDS'] as $key => $keywords) {
+ foreach($language_data['KEYWORDS'] as $key2 => $keywords2) {
+ if($key2 <= $key) {
+ continue;
+ }
+ $kw_diffs = array_intersect($keywords, $keywords2);
+ foreach($kw_diffs as $kw) {
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS'])) {
+ //Check the precondition\post-cindition for the involved keyword groups
+ $g1_pre = $disallowed_before;
+ $g2_pre = $disallowed_before;
+ $g1_post = $disallowed_after;
+ $g2_post = $disallowed_after;
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
+ $g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
+ $g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
+ }
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
+ $g1_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
+ $g2_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
+ }
+
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'])) {
+ $g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'];
+ }
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'])) {
+ $g1_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'];
+ }
+
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'])) {
+ $g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'];
+ }
+ if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'])) {
+ $g2_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'];
+ }
+
+ if($g1_pre != $g2_pre || $g1_post != $g2_post) {
+ continue;
+ }
+ }
+ report_error(TYPE_WARNING, "Language file contains cross-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key] and \$language_data['KEYWORDS'][$key2]!");
+ }
+ }
+ }
+ foreach($language_data['CASE_SENSITIVE'] as $key => $keywords) {
+ if(!isset($language_data['KEYWORDS'][$key]) && $key != GESHI_COMMENTS) {
+ report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['CASE_SENSITIVE'] specification for non-existing keyword group $key!");
+ }
+ }
+ foreach($language_data['URLS'] as $key => $keywords) {
+ if(!isset($language_data['KEYWORDS'][$key])) {
+ report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['URLS'] specification for non-existing keyword group $key!");
+ }
+ }
+ foreach($language_data['STYLES']['KEYWORDS'] as $key => $keywords) {
+ if(!isset($language_data['KEYWORDS'][$key])) {
+ report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['STYLES']['KEYWORDS'] specification for non-existing keyword group $key!");
+ }
+ }
+
+ foreach($language_data['COMMENT_SINGLE'] as $ck => $cv) {
+ if(!is_int($ck)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_SINGLE'] that is not integer!");
+ }
+ if(!is_string($cv)) {
+ report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_SINGLE'][$ck]!");
+ }
+ if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
+ report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
+ }
+ }
+ if(isset($language_data['COMMENT_REGEXP'])) {
+ foreach($language_data['COMMENT_REGEXP'] as $ck => $cv) {
+ if(!is_int($ck)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_REGEXP'] that is not integer!");
+ }
+ if(!is_string($cv)) {
+ report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_REGEXP'][$ck]!");
+ }
+ if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
+ report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
+ }
+ }
+ }
+ foreach($language_data['STYLES']['COMMENTS'] as $ck => $cv) {
+ if($ck != 'MULTI' && !isset($language_data['COMMENT_SINGLE'][$ck]) &&
+ !isset($language_data['COMMENT_REGEXP'][$ck])) {
+ report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['COMMENTS'] specification for Single Line or Regular-Expression Comment key $ck!");
+ }
+ }
+ if (isset($language_data['STYLES']['STRINGS']['HARD'])) {
+ if (empty($language_data['HARDQUOTE'])) {
+ report_error(TYPE_NOTICE, "Language file contains superfluous \$language_data['STYLES']['STRINGS'] specification for key 'HARD', but no 'HARDQUOTE's are defined!");
+ }
+ unset($language_data['STYLES']['STRINGS']['HARD']);
+ }
+ foreach($language_data['STYLES']['STRINGS'] as $sk => $sv) {
+ if($sk && !isset($language_data['QUOTEMARKS'][$sk])) {
+ report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['STRINGS'] specification for non-existing quotemark key $sk!");
+ }
+ }
+
+ foreach($language_data['REGEXPS'] as $rk => $rv) {
+ if(!is_int($rk)) {
+ report_error(TYPE_WARNING, "Language file contains an key '$rk' in \$language_data['REGEXPS'] that is not integer!");
+ }
+ if(is_string($rv)) {
+ //Check for unmasked / in regular expressions ...
+ if(empty($rv)) {
+ report_error(TYPE_WARNING, "Language file contains an empty regular expression at \$language_data['REGEXPS'][$rk]!");
+ } else {
+ if(preg_match("/(?)/s", $rv)) {
+ report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
+ }
+ }
+ } elseif(is_array($rv)) {
+ if(!isset($rv[GESHI_SEARCH])) {
+ report_error(TYPE_ERROR, "Language file contains no GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
+ } elseif(!is_string($rv[GESHI_SEARCH])) {
+ report_error(TYPE_ERROR, "Language file contains a GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
+ } else {
+ if(preg_match("/(?)/s", $rv[GESHI_SEARCH])) {
+ report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
+ }
+ }
+ if(!isset($rv[GESHI_REPLACE])) {
+ report_error(TYPE_WARNING, "Language file contains no GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
+ } elseif(!is_string($rv[GESHI_REPLACE])) {
+ report_error(TYPE_ERROR, "Language file contains a GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
+ }
+ if(!isset($rv[GESHI_MODIFIERS])) {
+ report_error(TYPE_WARNING, "Language file contains no GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
+ } elseif(!is_string($rv[GESHI_MODIFIERS])) {
+ report_error(TYPE_ERROR, "Language file contains a GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
+ }
+ if(!isset($rv[GESHI_BEFORE])) {
+ report_error(TYPE_WARNING, "Language file contains no GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
+ } elseif(!is_string($rv[GESHI_BEFORE])) {
+ report_error(TYPE_ERROR, "Language file contains a GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
+ }
+ if(!isset($rv[GESHI_AFTER])) {
+ report_error(TYPE_WARNING, "Language file contains no GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
+ } elseif(!is_string($rv[GESHI_AFTER])) {
+ report_error(TYPE_ERROR, "Language file contains a GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
+ }
+ } else {
+ report_error(TYPE_WARNING, "Language file contains an non-string and non-array entry at \$language_data['REGEXPS'][$rk]!");
+ }
+ if(!isset($language_data['STYLES']['REGEXPS'][$rk])) {
+ report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['REGEXPS'] specification for regexp group $rk!");
+ }
+ }
+ foreach($language_data['STYLES']['REGEXPS'] as $rk => $rv) {
+ if(!isset($language_data['REGEXPS'][$rk])) {
+ report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['REGEXPS'] specification for regexp key $rk!");
+ }
+ }
+
+
+ }
+
+ output_error_cache();
+
+ flush();
+
+ if($error_abort) {
+ break;
+ }
+ }
+}
+
+$time_end = explode(' ', microtime());
+$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
+
+if ( PHP_SAPI != 'cli' ) {
+?>
+
+
+Validation process completed in printf("%.2f", $time_diff); ?> seconds.
+
+
+
+
+
+
+
+Validation process completed in printf("%.2f", $time_diff); ?> seconds.
+
+GeSHi © 2004-2007 Nigel McNie, 2007-2012 Benny Baumann, released under the GNU GPL
+
+
\ No newline at end of file
diff --git a/plugins/codesnippetgeshi/dev/geshi/contrib/langwiz.php b/plugins/codesnippetgeshi/dev/geshi/contrib/langwiz.php
new file mode 100644
index 00000000000..32d025a95a7
--- /dev/null
+++ b/plugins/codesnippetgeshi/dev/geshi/contrib/langwiz.php
@@ -0,0 +1,1158 @@
+Failed
";
+ echo "\n";
+ foreach($error_cache as $error_msg) {
+ echo "- ";
+ switch($error_msg['t']) {
+ case TYPE_NOTICE:
+ echo "NOTICE:";
+ break;
+ case TYPE_WARNING:
+ echo "WARNING:";
+ break;
+ case TYPE_ERROR:
+ echo "ERROR:";
+ break;
+ }
+ echo " " . $error_msg['m'] . "
";
+ }
+ echo "
\n";
+ } else {
+ echo "OK
";
+ }
+ echo "\n";
+
+ $error_cache = array();
+}
+
+function report_error($type, $message) {
+ global $error_cache, $error_abort;
+
+ $error_cache[] = array('t' => $type, 'm' => $message);
+ if(TYPE_ERROR == $type) {
+ $error_abort = true;
+ }
+}
+
+?>
+
+
+
+ GeSHi Language File Generator Script
+
+
+
+GeSHi Language File Generator Script
+To use this script, make sure that geshi.php is in the
+parent directory or in your include_path, and that the language files are in a
+subdirectory of GeSHi's directory called geshi/.
+If not already done, select a language file below that will be used as
+base for the language file to generate or create a blank one. Following this
+you can do whatever you like to edit your language file. But note that not all
+features are made available through this script.
+
+Checking GeSHi installation ... 'example',
+ 'name' => 'Example'
+ );
+
+$ai = array(
+ 'name' => 'Benny Baumann',
+ 'email' => 'BenBE@geshi.org',
+ 'web' => 'http://qbnz.com/highlighter/'
+ );
+
+$ld = array(
+ 'cmt' => array(
+ 'sl' => array(
+ 1 => array(
+ 'start' => '//',
+ 'style' => 'font-style: italic; color: #666666;'
+ ),
+ 2 => array(
+ 'start' => '#',
+ 'style' => 'font-style: italic; color: #666666;'
+ )
+ ),
+ 'ml' => array(
+ 1 => array(
+ 'start' => '/*',
+ 'end' => '*/',
+ 'style' => 'font-style: italic; color: #666666;'
+ ),
+ 2 => array(
+ 'start' => '/**',
+ 'end' => '*/',
+ 'style' => 'font-style: italic; color: #006600;'
+ )
+ ),
+ 'rxc' => array(
+ 1 => array(
+ 'rx' => '/Hello RegExp/',
+ 'style' => 'font-style: italic; color: #666666;'
+ )
+ )
+ ),
+ 'str' => array(
+ 'qm' => array(
+ 1 => array(
+ 'delim' => "'",
+ 'style' => 'color: #0000FF;'
+ ),
+ 2 => array(
+ 'delim' => """,
+ 'style' => 'color: #0000FF;'
+ )
+ ),
+ 'ec' => array(
+ 'char' => '\\',
+ 'style' => 'font-weight: bold; color: #000080;'
+ ),
+ 'erx' => array(
+ 1 => array(
+ 'rx' => '/\{\\\\$\w+\}/',
+ 'style' => 'font-weight: bold; color: #008080;'
+ ),
+ 2 => array(
+ 'rx'=> '/\{\\\\$\w+\}/',
+ 'style' => 'font-weight: bold; color: #008080;'
+ )
+ )
+ ),
+ 'kw_case' => 'GESHI_CAPS_NO_CHANGE',
+ 'kw' => array(
+ 1 => array(
+ 'list' => '',
+ 'case' => '0',
+ 'style' => 'color: #0000FF; font-weight: bold;',
+ 'docs' => ''
+ )
+ ),
+ 'sy' => array(
+ 0 => array(
+ 'list' => '',
+ 'style' => 'color: #0000FF; font-weight: bold;'
+ )
+ )
+ );
+
+$kw_case_sel = array(
+ 'GESHI_CAPS_NO_CHANGE' => '',
+ 'GESHI_CAPS_UPPER' => '',
+ 'GESHI_CAPS_LOWER' => ''
+ );
+
+$kw_cases_sel = array(
+ 1 => array(
+ 0 => '',
+ 1 => ''
+ )
+ );
+// --- empty variables for values of $_POST - end ---
+
+echo "
";
+//var_dump($languages);
+
+foreach($post_var_names as $varName) { // export wanted variables of $_POST array...
+ if(array_key_exists($varName, $_POST)) {
+ $$varName = htmlspecialchars_deep($_POST[$varName]);
+ }
+}
+
+// determine the selected kw_case...
+$kw_case_sel[$ld['kw_case']] = ' selected="selected"';
+
+// determine the selected kw_cases...
+for($i = 1; $i <= count($kw_cases_sel); $i += 1) {
+ $kw_cases_sel[$i][(int) $ld['kw'][$i]['case']] = ' selected="selected"';
+}
+
+$lang = validate_lang();
+var_dump($lang);
+echo "
";
+
+?>
+
+
+
+Operation completed in
+$time_end = explode(' ', microtime());
+$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
+
+echo sprintf("%.2f", $time_diff);
+?> seconds.
+
+
+
+
+
+
+function str_to_phpstring($str, $doublequote = false){
+ if($doublequote) {
+ return '"' . strtr($str,
+ array(
+ "\"" => "\\\"",
+ "\\" => "\\\\",
+ "\0" => "\\0",
+ "\n" => "\\n",
+ "\r" => "\\r",
+ "\t" => "\\t",
+ "\$" => "\\\$"
+ )
+ ) . '"';
+ } else {
+ return "'" . strtr($str,
+ array(
+ "'" => "\\'",
+ "\\" => "\\\\"
+ )
+ ) . "'";
+ }
+}
+
+function validate_lang(){
+ $ai = array(
+ 'name' => 'Benny Baumann',
+ 'email' => 'BenBE@geshi.org',
+ 'web' => 'http://qbnz.com/highlighter/'
+ );
+
+ $li = array(
+ 'file' => 'example',
+ 'desc' => 'Example'
+ );
+
+ if(isset($_POST['ld'])) {
+ $ld = $_POST['ld'];
+ } else {
+ $ld = array(
+ 'cmt' => array(
+ 'sl' => array(
+ 1 => array(
+ 'start' => '//',
+ 'style' => 'test'
+ )
+ ),
+ 'ml' => array(
+ 1 => array(
+ 'start' => '/*',
+ 'end' => '*/',
+ 'style' => 'font-style: italic; color: #666666;'
+ )
+ ),
+ 'rxc' => array(
+ 1 => array(
+ 'rx' => '/Hello/',
+ 'style' => 'color: #00000'
+ )
+ )
+ ),
+ 'str' => array(
+ 'qm' => array(),
+ 'ec' => array(
+ 'char' => ''
+ ),
+ 'erx' => array()
+ ),
+ 'kw' => array(),
+ 'kw_case' => 'GESHI_CAPS_NO_CHANGE',
+ 'sy' => array()
+ );
+ }
+
+ return array('ai' => $ai, 'li' => $li, 'ld' => $ld);
+}
+
+function gen_langfile($lang){
+ $langfile = $lang['li']['file'];
+ $langdesc = $lang['li']['desc'];
+
+ $langauthor_name = $lang['ai']['name'];
+ $langauthor_email = $lang['ai']['email'];
+ $langauthor_web = $lang['ai']['web'];
+
+ $langversion = GESHI_VERSION;
+
+ $langdate = date('Y/m/d');
+ $langyear = date('Y');
+
+ $i = ' ';
+ $i = array('', $i, $i.$i, $i.$i.$i);
+
+ $src = << ".str_to_phpstring($langdesc).",\n";
+
+ //Comments
+ $src .= $i[1] . "'COMMENT_SINGLE' => array(\n";
+ foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
+ $src .= $i[2] . ((int)$idx_cmt_sl). " => ". str_to_phpstring($tmp_cmt_sl['start']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'COMMENT_MULTI' => array(\n";
+ foreach($lang['ld']['cmt']['ml'] as $tmp_cmt_ml) {
+ $src .= $i[2] . str_to_phpstring($tmp_cmt_ml['start']). " => ". str_to_phpstring($tmp_cmt_ml['end']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'COMMENT_REGEXP' => array(\n";
+ foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
+ $src .= $i[2] . ((int)$idx_cmt_rxc). " => ". str_to_phpstring($tmp_cmt_rxc['rx']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+
+ //Case Keywords
+ $src .= $i[1] . "'CASE_KEYWORDS' => " . $lang['ld']['kw_case'] . ",\n";
+
+ //Quotes \ Strings
+ $src .= $i[1] . "'QUOTEMARKS' => array(\n";
+ foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
+ $src .= $i[2] . ((int)$idx_str_qm). " => ". str_to_phpstring($tmp_str_qm['delim']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'ESCAPE_CHAR' => " . str_to_phpstring($lang['ld']['str']['ec']['char']) . ",\n";
+ $src .= $i[1] . "'ESCAPE_REGEXP' => array(\n";
+ foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
+ $src .= $i[2] . ((int)$idx_str_erx). " => ". str_to_phpstring($tmp_str_erx['rx']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+
+ //HardQuotes
+ $src .= $i[1] . "'HARDQUOTE' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'HARDESCAPE' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'HARDCHAR' => '',\n";
+
+ //Numbers
+ $src .= $i[1] . "'NUMBERS' =>\n";
+ $src .= $i[2] . "GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |\n";
+ $src .= $i[2] . "GESHI_NUMBER_FLT_SCI_ZERO,\n";
+
+ //Keywords
+ $src .= $i[1] . "'KEYWRODS' => array(\n";
+ foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
+ $src .= $i[2] . ((int)$idx_kw) . " => array(\n";
+ if(!is_array($tmp_kw['list'])) {
+ $tmp_kw['list'] = explode("\n", $tmp_kw['list']);
+ }
+ $tmp_kw['list'] = array_map('trim', $tmp_kw['list']);
+ sort($tmp_kw['list']);
+ $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
+ $kw_nl = true;
+ $kw_pos = 0;
+ foreach($kw_esc as $kw_data) {
+ if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
+ $src .= "\n";
+ $kw_nl = true;
+ $kw_pos = 0;
+ }
+ if($kw_nl) {
+ $src .= $i[3];
+ $kw_pos += strlen($i[3]);
+ $kw_nl = false;
+ }
+ $src .= $kw_data . ', ';
+ $kw_pos += strlen($kw_data) + 2;
+ }
+ $src .= "\n";
+ $src .= $i[3] . "),\n";
+ }
+ $src .= $i[2] . "),\n";
+
+ //Case Sensitivity
+ $src .= $i[1] . "'CASE_SENSITIVE' => array(\n";
+ foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
+ $src .= $i[2] . ((int)$idx_kw) . " => " . ($tmp_kw['case'] ? 'true' : 'false') . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+
+ //Symbols
+ $src .= $i[1] . "'SYMBOLS' => array(\n";
+ foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
+ $src .= $i[2] . ((int)$idx_kw) . " => array(\n";
+ $tmp_kw['list'] = (array)$tmp_kw['list'];
+ sort($tmp_kw['list']);
+ $kw_esc = array_map('str_to_phpstring', $tmp_kw['list']);
+ $kw_nl = true;
+ $kw_pos = strlen($i[3]);
+ foreach($kw_esc as $kw_data) {
+ if((strlen($kw_data) + $kw_pos > 79) && $kw_pos > strlen($i[3])) {
+ $src .= "\n";
+ $kw_nl = true;
+ $kw_pos = 0;
+ }
+ if($kw_nl) {
+ $src .= $i[3];
+ $kw_pos += strlen($i[3]);
+ $kw_nl = false;
+ }
+ $src .= $kw_data . ', ';
+ $kw_pos += strlen($kw_data) + 2;
+ }
+ $src .= "\n";
+ $src .= $i[3] . "),\n";
+ }
+ $src .= $i[2] . "),\n";
+
+ //Styles \ CSS
+ $src .= $i[1] . "'STYLES' => array(\n";
+ $src .= $i[2] . "'KEYWRODS' => array(\n";
+ foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
+ $src .= $i[3] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['style']) . ",\n";
+ }
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'COMMENTS' => array(\n";
+ foreach($lang['ld']['cmt']['sl'] as $idx_cmt_sl => $tmp_cmt_sl) {
+ $src .= $i[3] . ((int)$idx_cmt_sl) . " => " . str_to_phpstring($tmp_cmt_sl['style']) . ",\n";
+ }
+ foreach($lang['ld']['cmt']['rxc'] as $idx_cmt_rxc => $tmp_cmt_rxc) {
+ $src .= $i[3] . ((int)$idx_cmt_rxc) . " => " . str_to_phpstring($tmp_cmt_rxc['style']) . ",\n";
+ }
+ $src .= $i[3] . "'MULTI' => " . str_to_phpstring($lang['ld']['cmt']['ml'][1]['style']) . "\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'ESCAPE_CHAR' => array(\n";
+ foreach($lang['ld']['str']['erx'] as $idx_str_erx => $tmp_str_erx) {
+ $src .= $i[3] . ((int)$idx_str_erx). " => ". str_to_phpstring($tmp_str_erx['style']) . ",\n";
+ }
+ // 'HARD' => 'color: #000099; font-weight: bold;'
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'BRACKETS' => array(\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'STRINGS' => array(\n";
+ foreach($lang['ld']['str']['qm'] as $idx_str_qm => $tmp_str_qm) {
+ $src .= $i[3] . ((int)$idx_str_qm). " => ". str_to_phpstring($tmp_str_qm['style']) . ",\n";
+ }
+ // 'HARD' => 'color: #0000ff;'
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'NUMBERS' => array(\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'METHODS' => array(\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'SYMBOLS' => array(\n";
+ foreach($lang['ld']['sy'] as $idx_kw => $tmp_kw) {
+ $src .= $i[3] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['style']) . ",\n";
+ }
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'REGEXPS' => array(\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "'SCRIPT' => array(\n";
+ $src .= $i[3] . "),\n";
+ $src .= $i[2] . "),\n";
+
+ //Keyword Documentation
+ $src .= $i[1] . "'URLS' => array(\n";
+ foreach($lang['ld']['kw'] as $idx_kw => $tmp_kw) {
+ $src .= $i[2] . ((int)$idx_kw) . " => " . str_to_phpstring($tmp_kw['docs']) . ",\n";
+ }
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'OOLANG' => false,\n";
+ $src .= $i[1] . "'OBJECT_SPLITTERS' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'REGEXPS' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'STRICT_MODE_APPLIES' => GESHI_MAYBE,\n";
+ $src .= $i[1] . "'SCRIPT_DELIMITERS' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'HIGHLIGHT_STRICT_BLOCK' => array(\n";
+ $src .= $i[2] . "),\n";
+ $src .= $i[1] . "'TAB_WIDTH' => 4,\n";
+
+ $src .= <<
+GESHI_LANGFILE_FOOTER;
+
+ //Reduce source ...
+ $src = preg_replace('/array\(\s*\)/s', 'array()', $src);
+ $src = preg_replace('/\,(\s*\))/s', '\1', $src);
+ $src = preg_replace('/\s+$/m', '', $src);
+
+ return $src;
+}
+
+// vim: shiftwidth=4 softtabstop=4
+?>
diff --git a/plugins/codesnippetgeshi/dev/geshi/docs/BUGS b/plugins/codesnippetgeshi/dev/geshi/docs/BUGS
new file mode 100644
index 00000000000..8a5cf04694c
--- /dev/null
+++ b/plugins/codesnippetgeshi/dev/geshi/docs/BUGS
@@ -0,0 +1,29 @@
+
+ BUGS - list of known bugs in GeSHi
+ Version 1.0.8
+
+- Number highlighting is quite poor [possibly better now]
+- I'm not happy with URLS - there still could be extra bugs, and it's rather unflexible
+ (see TODO for a possible fix)
+- "Important" sections for some reason seem to have their spans added after every
+ newline up until the next lexic, instead of stopping at the part. In fact,
+ context sensitiveness is quite poor...
+- Using the extra line number highlighting feature without actually using line numbers
+ will result in malformed XHTML (not sure about this one though...)
+- Slow!!! Especially for source with lots of strings in it. GeSHi will work acceptably
+ for sourcecode under 5K (for simple language files like SQL, a 100K file can be
+ highlighted in just 6 seconds), but above about 25K things get a little slow... If
+ you're using this as part of some larger software, you may want to think about
+ making some sort of "cache" effect to speed things up and reduce server load.
+- The result is built by string replacement instead of by building another string based
+ on the source, that would be much safer. The focus of releases beyond 1.0.7 will be on
+ changing this behaviour, which may well fix some of the other bugs mentioned above.
+- As of 1.0.7.1, dots (.) are allowed before keywords. This may change highlighting of some
+ things slightly, if you notice anything odd about the highlighting then please report
+ it to me.
+- Perl/Javascript /.../ regex syntax is only supported basically and there's no
+ guarantee it is working all the time.
+- The header output is not XHTML compliant. Please use the header instead.
+
+Send any bug reports to BenBE@omorphia.de, or submit them via the bug tracker at
+sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
diff --git a/plugins/codesnippetgeshi/dev/geshi/docs/CHANGES b/plugins/codesnippetgeshi/dev/geshi/docs/CHANGES
new file mode 100644
index 00000000000..ee510fe02e2
--- /dev/null
+++ b/plugins/codesnippetgeshi/dev/geshi/docs/CHANGES
@@ -0,0 +1,923 @@
+
+ CHANGES - Changelog for GeSHi (geshi.php only)
+
+Changes to the code are listed under the version they occured in, with who suggested
+it by each one (if there's nobody listed as suggesting it I dreamed it up :)). Users
+who suggested an idea often also provided the code that was used as a basis for the
+changes - thanks to all who suggested these ideas and gave me the code to show me how!
+
+Language files listed under each version were made by the author beside them, and then
+modified by me for consistency/bug fixing.
+
+Please send any bug reports to BenBE@omorphia.de, or use the bug report tracker
+at sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
+
+Version 1.0.8.11
+ - Added language files
+ * ARM (Marat Dukhan)
+ * Asymptote (Manuel Yguel)
+ * DCL (Petr Hendl)
+ * DCPU-16 (Benny Baumann)
+ * FreeSWITCH (James Rose)
+ * Haxe (Andy Li, John Liao)
+ * LDIF (Bruno Harbulot)
+ * Nagios (Albéric de Pertat)
+ * Octave (Carnë Draug, Juan Pablo Carbajal)
+ * ParaSail (sttaft)
+ * PARI/GP (Charles R Greathouse IV)
+ * Python for S60 (Sohan Basak)
+ * Rexx (Jon Wolfers)
+ * SPARK (Phil Thornley)
+ * SPARQL (Karima Rafes)
+ * StoneScript (Archimmersion)
+ * UPC (Viraj Sinha)
+ * Urbi (Alexandre Morgand)
+ * Vedit (Pauli Lindgren)
+ - Updated aliasd.php contrib script (SF#3073275, count)
+ - Fallback to "text" when extension is unknown (SF#3514714, murkymark, BenBE)
+ - detect extensions case-insensitive (SF#3514714, murkymark, BenBE)
+ - Fixed two bugs within contrib scripts included with each release (BenBE)
+ - Improvements to language files (BenBE)
+ * Symbol and char literal handling for Scala (Paul Butcher, BenBE)
+ * Multiline comments of F# weren't actually multiline (BenBE)
+ * Support for IPv6 addresses in RFC822 messages (BenBE)
+ * Properly handle retrieving names from language files (MikeSee, BenBE)
+ * Changes for improved highlighting of signle line comments and end-of-code indicators
+ * Missing keywords and improved highlighting of comments
+ * Problem with DOS/Batch highlighting breaking out at variables (BenBE)
+ * Addition of MMX/SSE/x86-64 registers and MMX/SSE instructions for
+ ASM language file(up to 4.2) (Dennis Yurichev)
+ * Further improvements to ASM language file to introduce all latest
+ already documented x86 architecture instructions (Marat Dukhan)
+ * Fixed links for R/S+ language file (Fernando H.F.P. da Rosa)
+ * Fix a problem with Delphi/Pascal regarding hex numbers/chars (BenBE)
+ * Fixed a typo and missing keywords for HTML4 and HTML5 (SF#3365452, BenBE)
+ * Fixed a typo in Modula-3 language file (SF#3358216, BenBE)
+ * Added missing keywords for MySQL (SF#3290998, ct-bob, BenBE)
+ * Added missing keywords for Pascal (SF#3176749, BenBE)
+ * Properly detect the keyword that is to be linked (BenBE)
+ * Updated VHDL language file (Kevin Thibedeau)
+ * Added missing keyword for Verilog (SF#3557903, BenBE)
+ * Fixed typo in Haskell causing a keyword to be missing (SF#3529439, BenBE)
+ * Fixed Long String handling for Lua (SF#3541510, Tim Starling)
+ * Updated JavaDoc links for Java language files (SF#3538552, jeneag, BenBE)
+ * CSS keywords incorrectly highlighted as part of identifiers (SF#3554101, BenBE)
+ * CSS3 keywords missing from highlighting (SF#3525084, vlaKoff, BenBE)
+ * Make variable handling compatible to PHP (SF#3489142, BenBE)
+ * Fixed obsolete MySQL documentation links (SF#3441642, BenBE)
+ * Add mising keywords for T-SQL (SF#3435026, BenBE)
+ * Fix discarded text when highlighting TypoScript (SF#3160238, BenBE)
+Version 1.0.8.10
+ - Added language files
+ * BASCOM AVR (Michal Goralczyk)
+ * C: Loadrunner dialect (Stuart Moncrieff)
+ * CoffeeScript (Trevor Burnham)
+ * EPC (Thorsten Muehlfelder)
+ * Euphoria (Nicholas Koceja)
+ * Falcon (billykater)
+ * HTML5 (Robert Lidberg)
+ * LLVM (Azriel Fasten)
+ * PL/I (Robert Prins)
+ * ProFTPd (Benny Baumann)
+ * PyCon (Benny Baumann)
+ * UnrealScript (pospi)
+ * YAML (Josh Ventura)
+ - Small bugfix in LangCheck when looking for language files
+ - Added '-' to list of RX chars that require explicit escaping (SF#3056454, BenBE)
+ - Minor changes to boundary checks (SF#3077256, BenBE)
+ - Improvements to language files (BenBE)
+ * Major rework of the ALGOL68 language file (Neville Dempsey)
+ * LangCheck warnings from GO language file (BenBE)
+ * Some additions to the Objeck language file (Randy Hollines)
+ * Properly highlight infinity as numbers for J (Ric Sherlock)
+ * Improved GDB Backtrace language file (Milian Wolff)
+ * Updated Liberty BASIC language file (Chris Iverson)
+ * Fixed a small issue with detection of division vs. regular expressions
+ for ActionScript 3 and JavaScript (Kevin Day)
+ * Fixed Escape handling for CSS (SF#3080513, yecril71pl, BenBE)
+ * Additional comment styles for SAS (SF#3024708, ahnolds, BenBE)
+ * Updated keyword list for TeraTerm (Boris Maisuradze)
+ * Incorrect handling of /**/ comments in Javascript (BenBE)
+ * Support for mod_upload_progress in Apache Config files (BenBE)
+ * Prefix operator handling in F# was broken (BenBE)
+ * CDATA handling for html4strict (BenBE)
+ * Common subcommands for Apache, APT, CVS, Git, SVN and YUM for Bash (BenBE)
+ * Limited support for prompt detection in single line Bash snippets (BenBE)
+ * Added functions of the C standard library (BenBE)
+ * Rework of Lua to use GeSHi's features better (BenBE)
+ * Language file improvements for Python (Zbyszek Szmek)
+ * Fixed documentation links for Groovy (SF#3152356, lifeisfoo)
+ * Fixed incorrect highlighting of certain keywords in Erlang (SF#3138853, BenBE)
+ * Escape chars in C++/C++Qt handled incorrectly (SF#3122706, C. Pötsch)
+ * Empty parameters of LaTeX commands tipped the highlighting off (SF#3098329, James Oldfield, BenBE)
+ * Additional Keywords and minor tweaks to Logtalk (Paulo Moura)
+Version 1.0.8.9
+ - Added language files
+ * Algol68 (Neville Dempsey)
+ * E (Kevin Reid)
+ * FormulaOne (Juro Bystricky)
+ * Go (Markus Jarderot)
+ * Liberty BASIC (Chris Iverson)
+ * MOS 6502/6510 Assemblers (Warren Willmey)
+ * Motorola 68k assembler (Warren Willmey)
+ * Objeck Programming Language (Randy Hollines)
+ * ZXBasic (Jose Rodriguez)
+ - Added support for $-prefixed hex numbers and @-prefixed octal numbers
+ - Added Parser Control for languages to tell when numbers are present
+ inside of non-string parts
+ - Introduced querying supported/known languages directly
+ - Introduced querying full language names without loading the language file
+ - Improvements to language files (BenBE)
+ * Added loads of keywords for generic SQL highlighting (Jürgen Thomas)
+Version 1.0.8.8
+ - Added language files
+ * ChaiScript (Jason Turner & Jonathan Turner)
+ * Genie (Nicolas Joseph)
+ * GwBasic (José Gabriel Moya Yangüela)
+ * HicEst (Georg Petrich)
+ * Icon (Matt Oates)
+ * MagikSF (Sjoerd van Leent)
+ * Modula 2 (Benjamin Kowarsch)
+ * Oz (Wolfgang Meyer)
+ * PCRE (BenBE)
+ * PostgreSQL (Christophe Chauvet)
+ * q/kdb+ (Ian Roddis)
+ * RPM Specification Files (Paul Grinberg)
+ * Unicon (Matt Oates)
+ * Vala (Nicolas Joseph)
+ * XBasic (José Gabriel Moya Yangüela)
+ - Improvements to language files (BenBE)
+ * Major reworks and improvements to OCaml language file (BenBE)
+ * Removed duplicate entries from keyword groups of VIM language file (Segaja)
+ * Properly protect Regexps against GeSHi Black Magic in Matlab (BenBE)
+ * Added support for Block Comments in PowerShell (BenBE)
+ * Added some keywords for VB; split into multiple groups (leejkennedy, BenBE)
+ * Basic Heredoc Support for Ruby (BenBE)
+Version 1.0.8.7
+ - Added language files
+ * Autoconf (Mihai Vasilian)
+ * ECMAScript (Michel Mariani)
+ * J (Ric Sherlock)
+ * OpenBSD Packet Filter (David Berard)
+ * Oxygene / Delphi Prism (Carlo Kok)
+ - Minor change in INT_BASIC number regexp to support '..' range operator
+ as to be found in most Pascal-like languages (BenBE)
+ - Fixed an issue with Hardquotes for empty strings (like '' in Delphi) (BenBE)
+ - Introduced a fix for improved performance when matching numbers (BenBE)
+ - Improvements to language files (BenBE)
+ * Fixed broken links in Prolog language file (BenBE)
+ * Fixed keywords in generics expressions in Java5 (BenBE)
+ * Added support for import static in Java5 (BenBE)
+ * Added Standard Integer Types for C and c++ (BenBE)
+ * Fixed some regexp issues in Erlang (BenBE)
+ * Added some missing keywords for Clojure (BenBE)
+ * Added some missing keywords for Lisp (BenBE)
+ * Fixed a problem with variable names in Prolog (BenBE)
+ * Some color changes for AutoIt (BenBE)
+ * Added support for basic include directive processing for AutoIt (BenBE)
+ * Added support for ::-style labels as comments (SF#2947393, BenBE)
+ * Removed backslash as Escape Char in T-SQL (SF#2939199, Bruno Braga)
+ * Added Nested Comments Support for Haskell (SF#2922317, BenBE)
+ * Fixed Comments for VIM, added some keywords, proposed porting of
+ Regular Expression markup from Perl (SF#2818047, psycojoker, BenBE)
+ * Fixed warnings for Language Check of Tcl (BenBE)
+Version 1.0.8.6
+ - Added language files
+ * Clojure (Jess Johnson)
+ * Cuesheet (Benny Baumann)
+ * F# (Julien Ortin)
+ * GAMBAS (Jesus Guardon)
+ * Logtalk (Paulo Moura)
+ * MapBasic (Tomasz Berus)
+ * NewLisp (cormullion)
+ * Perl 6 (Kodi Arfer)
+ * Pike (Rick E.)
+ * SystemVerilog (Sean O'Boyle)
+ - Reworked parts of the number support (BenBE)
+ - Improvements to language files (BenBE)
+ * Fixed broken links in R/S+ language file (BenBE)
+ * Fixed an issue with if= argument for dd command (BenBE)
+ * T-SQL should use GESHI_CAPS_NO_CHANGE for keywords (BenBE)
+ * Fixed missed shorthand arg references in Bash (BenBE)
+ * Fixed first line not getting highlighted in diff language (BenBE)
+ * Added some keywords for csharp (RC)
+Version 1.0.8.5
+ - Added language files
+ * AutoHotkey (Naveen Garg)
+ * Awk (George Pollard)
+ * GADV 4CS (Jason Curl)
+ * jQuery (Rob Loach)
+ * PowerBuilder (Doug Porter)
+ * PureBasic (Gustavo Julio Fiorenza)
+ * R / S+ (Ron Fredericks, Benilton Carvalho)
+ - Fixed legitimate numbers sometimes missing from highlighting (BenBE)
+ - Fixed a problem with URLs allowing to break highlighting (BenBE)
+ - Allowed for String and Number Styles to be set by the API (BenBE)
+ - Produce valid CSS when languages start with underscore (BenBE)
+ - Duplicate newlines with PRE_TABLE-Header but w/o linenumbers (SF#2838958, BenBE)
+ - Improvements to language files (BenBE)
+ * Fixed case-insensitively duplicate keywords (BenBE)
+ * DCS language file contained HARDQUOTE section but no hardquotes (BenBE)
+ * Some additional headers for Email\mbox highlighting (BenBE)
+ * Added some more Keywords for robots.txt highlighting (BenBE)
+ * Added Git commands for bash, ifup/ifdown (BenBE)
+ * Added support for C# and VB.net delegates (SF#2832253, BenBE)
+ * Added support for line numbers, file handles and hex\octal numbers for QBasic (BenBE)
+Version 1.0.8.4
+ - Added language files
+ * BibTeX (Quinn Taylor)
+ * CMake (Daniel Nelson)
+ * Erlang (Benny Baumann, Dan Forest-Barbier, Uwe Dauernheim)
+ * FO (abas-ERP) (Tan-Vinh Nguyen)
+ * Property Files (Edy Hinzen)
+ * Whois (RPSL format) entries (Benny Baumann)
+ - Changed INT_BASIC number format to allow numbers followed . at EOL (BenBE)
+ - Higher prority for keywords over regexps (BenBE)
+ - Added missing set_script_style API function (BenBE)
+ - Fixed missing check for comment_regexp preference in HardQuotes (BenBE)
+ - Fixed a problem with Strict Block Detection if the Strict Block Regexp
+ requires matching groups for itself (BenBE)
+ - Improvements to language files (BenBE)
+ * Added PCRE regexp support for Action script (SF#2655644, BenBE)
+ * Removed some superfluous keywords from ABAP (BenBE)
+ * Removed duplicate keywords for Progress (BenBE)
+ * Removed duplicate keywords for T-SQL (BenBE)
+ * Linking for PowerShell special variables revised (BenBE)
+ * Fixed linking in ColdFusion (BenBE)
+ * Fixed linking in LaTeX (BenBE)
+ * Fixed linking in mIRC Scripting language (BenBE)
+ * Fixed escape char regexp for C-style languages (BenBE)
+ * Fixed @""-string handling for C# (SF#2789371, BenBE)
+ * Fixed Strict Block Detection for PHP blocks (BenBE)
+ * Changed allowed chars around Powershell operators (SF#2688863, BenBE)
+ * Minor reordering inside of PHP language file (BenBE)
+ * Added missing keywords for ActionScript3 language file (SF#2795005, BenBE)
+ * Added .xrc file extension for XML highlighting (BenBE)
+Version 1.0.8.3
+ - Added language files
+ * DCS (Stelio Passaris)
+ * Locomotive Basic (Nacho Cabanes)
+ * LSL2 (Linden Scripting Language) (William Fry)
+ * Modula-3 (Martin Bishop)
+ * Oberon-2 (Mike Mol)
+ * Rebol (Lecanu Guillaume)
+ - Fixed a problem where HardEscapes weren't working when no escape char was given (BenBE)
+ - Added a PARSER_CONTROL setting to treat whitespace inside of keywords in
+ the language file as "any whitespace" in the source (i.e. "CREATE TABLE"
+ in SQL will match "CREATE\s+TABLE" instead of literally matching) (BenBE)
+ - Added a possibility to allow setting the style for escape characters (BenBE)
+ - Improvements to language files (BenBE)
+ * Added some missing Perl keywords and obscure default variables (BenBE)
+ * Allow for escaped colons to appear in CSS names (BenBE, simon)
+ * Added multiline continuation suppoert of preprocessor defines for
+ C, C for Mac, C++ and CC++ with Qt support (BenBE)
+ * keywords for C-based languages are case-sensitive (BenBE)
+ * Broken AutoIt highlighting (BenBE)
+ * Problem with escaped backslash in PHP and D (BenBE)
+ * Added some more functions for PHP (BenBE)
+ * Some changes for AppleScript (Stefan Klieme)
+ * Forbid highlighting keywords followed by / in bash (BenBE)
+ * Updated the LaTeX file to link some keywords (BenBE)
+ * Additional text rendered when matching special variables for PowerShell (BenBE)
+ * Added some more keywords for ABAP (BenBE, Sandra Rossi, Jacob Laursen)
+Version 1.0.8.2
+ - Added language files
+ * Brainfuck \ Brainfork (Benny Baumann)
+ * HQ9+ (Benny Baumann)
+ * INTERCAL (Benny Baumann)
+ * LOLcode (Benny Baumann)
+ * LScript (Beau McGuigan)
+ * Pixel Bender (Richard Olsson)
+ * ProvideX (Jeff Wilder)
+ * VIM Script (Swaroop C H)
+ * Visual Prolog (Thomas Linder Puls)
+ * Whitespace (Benny Baumann)
+ - Changed priority for COMMENT_REGEXP compared to String highlighting (BenBE)
+ - Fixed correct escaping of spaces inside of URLs (BenBE)
+ - Updated the list of common file extensions (BenBE)
+ - Updated the language file check script in contrib/ (BenBE)
+ - Fixed a problem with link targets resulting in unclickable links (SF#2379120, BenBE)
+ - Fixed an undefined variable issue in langcheck.php (BenBE)
+ - Improvements to language files (BenBE)
+ * eMail Header highlighting now uses the correct delimiters for keywords (BenBE)
+ * eMail (RFC822\mbox) highlighting now highlights IPs, MIME types and
+ subfield assignments correctly (BenBE)
+ * Minor style changes in COBOL to improve loading performance (BenBE)
+ * Added some missing keywords for D (BenBE)
+ * Removed duplicate keywords from Progres, SAS and TSQL (BenBE)
+ * Fixed Heredoc Syntax for Bash (SF#2185319, BenBE)
+ * Moved symbol-lookalike sequences from keyword groups to separate symbol group
+ for languages asp, klonec, klonecpp, php, php-brief (BenBE)
+ * Fixed a lot of duplicate keyword warnings (BenBE)
+ * Added missing keywords to the Python language file,
+ introducing support for Python 3.0. (SF#2441839, milian)
+ * Updated documentation links for TypoScript (SF#2014276, BenBE)
+ * Fixed a problem with tag and attribute names in XML highlighting (SF#2276119, BenBE)
+ * Improved MySQL language file (BenBE, JavaWoman)
+ * Some commentss accidentially mistaken for DocComments (SF#2454897, BenBE)
+ * Added improved Escape Char handling for c, c_mac, cpp and cpp_qt (SF#2458743, BenBE)
+Version 1.0.8.1
+ - Added language files
+ * AviSynth (Ryan Jones)
+ * eMail \ mbox (Benny Baumann)
+ * GNU Make (Neil Bird)
+ * Oracle 11i support (Simon Redhead)
+ * Prolog (Benny Baumann)
+ * SciLab (Christophe David)
+ * TeraTerm macro language (Boris Maisuradze)
+ - Added support for Escape Regular Expressions (BenBE)
+ * Implemented C-style Escapes in PHP (BenBE)
+ * Introduced support for \xAB and \007 style Char Escapes in PHP (BenBE)
+ * Implemented Variable Highlighting in PHP (BenBE)
+ * Implemented Variable Highlighting in Bash (milian)
+ - Fixed a problem with PCRE patterns for Keyword matching sometimes producing
+ very large strings, that could not be handled by some versions of PCRE lib,
+ causing broken highlighting an Regexp Compile errors (BenBE, milian)
+ - Fixed broken highlighting of bash commands like `dbus-send --dest=org.....`,
+ i.e. the dest was highlighted as variable declaration (milian)
+ - Fixed broken highlighting of some symbols in their escaped form (BenBE)
+ (
and were accidentially filtered even though they are valid)
+ - Fixed a "memory leak" in the *_regexp_caches (milian)
+ - Fixed broken Escape chars if classes were disabled
+ - start_line_numbers_at() was ignored when GESHI_HEADER_PRE_TABLE was set (revulo)
+ - Fixed a problem allowing Remote Code Inclusion under certain circumstances (BenBE)
+ - Changes to default CSS in order to make the GESHI_HEADER_PRE_TABLE align properly,
+ even on Windows / Mac systems with strange fonts (milian, revulo, ^RT)
+ - Minor style changes to the following languages:
+ * cpp-qt (milian)
+ * MySQL (BenBE)
+ * PHP (BenBE)
+ - Improvements to language files (BenBE, milian)
+ * Added MinSpareThread\MaxSpareThreads to Apache highlighter (BenBE)
+ * Added new Keyword group for APT sources.list highlighter (BenBE)
+ * Fixed highlighting in LaTeX for \begin{} and \end{}, i.e. the stuff inside
+ the curly braces. (milian, thanks for the report go to Matthias Pospiech)
+ * Improved String support for D (BenBE)
+ * MySQL was seriously broken (BenBE)
+ * Reworked Keyword groups for MySQL to allow for more configuration (BenBE)
+ * Improved Mirc script language file (milian)
+ * Improved C++ Qt language file (milian)
+ * Minor bug with Transpose Operator in Matlab (BenBE, Daniele de Rigo)
+ * Highlighting of Batch Files for Windows (BenBE)
+ * Updated AutoIt to include latest changes for AutoIt v3.2.12.1 (BenBE, Thierry)
+ * Fixed duplicate keyword warnings for Perl, Tcl and Typoscript (BenBE)
+ * Fixed Doc-URL getting reparsed by highlighted keywords of other groups (BenBE, Jordi Boggiano)
+Version 1.0.8
+ - Added language files
+ * APT sources.list (milian)
+ * Boo (Marcus Griep)
+ * CIL (Common Intermediate Language, .NET Assembly) (Marcus Griep)
+ * COBOL (Benny Baumann)
+ * Gnuplot (milian)
+ * KLoneC (Mickael Auger)
+ * KLoneC++ (Mickael Auger)
+ * PIC16xxx assembler (Phil Mattison)
+ * POV-Ray (Carl Fürstenberg)
+ * PowerShell (Frode Aarebrot)
+ * Progress (Marco Aurelio de Pasqual)
+ * TypoScript (Jan-Philipp Halle)
+ * Xorg configuration (milian)
+ - Make GeSHi's constructor arguments optional, so something like `$foo = new GeSHi;` is possible. (milian)
+ - Added an optimizer for lists to regular expressions. Using these cached lists results in a speedup of approx. 50%.
+ The slightly increased memory consumption (~150KB for PHP language file) is more than worth it! (milian)
+ - Some more memory & speed optimizations all over GeSHi (milian)
+ * Reduced memory overhead when highlighting keywords (BenBE)
+ * Keyword Linking now uses considerably less strtolower calls (milian)
+ * Cache Symbol Search Regexp and make Symbol Highlighting faster (milian)
+ * Use more native functions like substr_replace and strcasecmp to speed things up (milian)
+ * Use considerably less strlen() calls on various points by caching the results (milian)
+ * Properly set comments to be case insensitive where appropriate to increase performance (milian)
+ * Improve the performance of the strict mode tokenizer, making highlighting of languages like
+ HTML, ColdFusion or XML faster (milian)
+ * Setup caches for parsing on demand to make stylesheet generators fast (milian)
+ - Various improvements to Strict Block Handling (BenBE, milian)
+ * Added support for RegExp-based Strict Blocks (BenBE)
+ * Fixed highlighting incorrectly stopping at ?> in PHP (SF#1330968, BenBE)
+ * Languages with STRICT_MODE_APPLIES = GESHI_MAYBE default to strict mode now. When no highlightable
+ code is found in this mode, we fallback to the same setting as if GESHI_NEVER was set. That way it
+ should not be needed to call enable_strictmode() manually. (milian)
+ - Added new GESHI_HEADER_PRE_VALID type which uses the following markup: (milian)
+ * With line numbers:
+ * Without line numbers: header...CODE...
+ => valid HTML and no need for indentation
+ - Added new GESHI_HEADER_PRE_TABLE type which can be used to prevent linenumber-selection in Firefox
+ on copy'n'paste. (milian)
+ - set_language will not reset any language settings by default anymore.
+ * Added $force_reset param for to force full reload of a language. (milian)
+ * Make sure strict_mode is set properly when doing repeated set_language calls (milian)
+ - Fixed some problems with old PHP versions (SF#1975625, milian, BenBE)
+ - Fixed broken use with Suhosin Patch when /e modifier was disabled (SF#2021800, BenBE)
+ - Added support for external style information files to override language defaults without modifying language files (BenBE)
+ - The overall_class is now up to the user, and the language-code is _always_ added as a class (milian)
+ - Fixed Economy Mode for GeSHi::get_stylesheet() - now it just makes so much more sense! (milian)
+ - Fixed Economy Mode when COMMENT_REGEXP are used (BenBE)
+ - Changed the default encoding to use UTF-8, due to SF#2037598, BenBE)
+ - Improved overall string support:
+ * Added support for multichar string delimiters (SF#1932083, BenBE)
+ * Fixed problems of unfinished strings and comments producing invalid XHTML (SF#1996353, BenBE)
+ * Multichar Quotemarks sometimes had inconsistent behaviour (BenBE)
+ * Support for multiple styles of strings depending on the starter (BenBE)
+ * Properly handle escapes in strings, i.e. '\\' was not working properly before (milian)
+ * Fixed escape char support when an escape char is followed by multi-byte chars (SF#2037598, BenBE)
+ - Improved flexibility in language files (BenBE, milian)
+ * Added PARSER_CONTROL for OOLANG method highlighting (SF#1923060, BenBE)
+ * Added possibility to define strict blocks using an Regexp (BenBE)
+ * Removed explicit escaping of / in Regular Expressions (BenBE)
+ * Ignoring empty keyword groups when highlighting (milian)
+ * Make language_permissions configurable in language files via ['PARSER_CONTROL']['ENABLE_FLAGS']
+ this makes is_a calls unneeded and thus prevents PHP notices in PHP 5.x (milian)
+ * Extended support for number formats now covering the most common formats (SF#1923058, BenBE)
+ * Lifted a limitation that keywords had to have at least 2 subsequent letters (BenBE)
+ * Changed behaviour of PARSER_CONTROL now allowing to provide the full Lookahead and Lookbehind
+ expressions used as delimiters inside keywords instead of a simple char group (BenBE)
+ * Fixed improper handling of newlines in REGEXPS so this does not produce invalid html anylonger (milian)
+ - Some typos and mistakes in the documentation (BenBE)
+ - Added a script to contrib/ to verify language files are correct (BenBE)
+ - Fixed loads of compliancy warnings detected with that automated compliance testing script (BenBE)
+ - Many other improvements to various language files (BenBE, milian)
+ * Reduce strict errors & notices for language files (milian)
+ * Fixed symbol highlighting with C++ sometimes missing keywords after ; and comments (BenBE)
+ * Improved comment handling with TCL (Lars Hellström, BenBE)
+ * Fixed broken handling with XML comments (BenBE, SF#1849233)
+ * Fixed HTML comments spawning multiple lines producing invalid XHTML output (SF#1738173, BenBE)
+ * Added support for parameters beginning with dash in BASH language (BenBE)
+ * Support Apache's configuration sections, see http://httpd.apache.org/docs/2.2/sections.html (milian)
+ * Minor issue with PHP Heredoc and Nowdoc syntax sometimes not getting highlighted (BenBE)
+ * Updated Objective-C language file (SF#2013961, Quinn Taylor, BenBE)
+ * Added some keywords for VHDL (beshig, BenBE)
+ * Fixed severly broken ColdFusion language file (milian)
+ * Fixed some incorrectly highlighted things with the CSS language file (milian, BenBE)
+ * Improved Smarty language file (milian)
+ * Improved CSS language file (milian)
+ * Improved Pascal language file (milian)
+ * Improved LaTeX language file (Ðндрей Парамонов, BenBE)
+ * Fixed a regular expression in mIRC language file that caused a warning message to be issued (BenBE)
+ * Removed <, > and / from HTML names, now only containing the real tag names (BenBE)
+ * Use spaces instead of tabs for indendation in language files to have a consistent
+ coding standard accross geshi files (milian)
+ * Added some comment styles, keywords and added index highlighting (Chusslove Illich, ЧаÑлав Илић)
+ - Removed some private methods which were only called at exactly one place (milian)
+ * format_header_content
+ * format_footer_content
+ * get_attributes
+ - Second part of default style changes. Affected in this release:
+ * C++
+ * C++ (Qt)
+ * CSS
+ * VHDL
+Version 1.0.7.22
+ - Added language files
+ * glSlang (BenBE)
+ * KiXtart (Riley McArdle)
+ * Lotus Notes @Formulas (Richard Civil)
+ * LotusScript (Richard Civil)
+ * MXML (David Spurr)
+ * Scala (Franco Lombardo)
+ * ActionScript 3 (Jordi Boggiano)
+ * GNU Gettext .po/.pot (Milian Wolff)
+ * Verilog (Günter Dannoritzer)
+ - Fixed a problem not yet addressed in 1.0.7.21 regarding highlighting of
+ symbols that caused some extra characters to be added in the output or
+ broke highlighting and standard compliance due to missing escaping of
+ internally used characters (SF#192320 and SF#1926259, BenBE)
+ - Fixed missing style information for ocaml language file (The_PHP_Jedi)
+ - Fixed a bug causing masses of warnings in rendered output if language file
+ miss style information (The_PHP_Jedi, BenBE)
+ - Missing tab width information could lead to warnings (BenBE)
+ - Missing symbol information for ASP (SF#1952038, nfsupport, BenBE)
+ - Empty delimiter message with OOoBasic (BenBE, Ccornell)
+ - Escaping of comments in LaTeX ignored (SF#1749806, BenBE)
+ - Modified Math environment $$ in LaTeX to be non-greedy (BenBE)
+ - Added possibility to match a regexp as comment (SF#1914640, SF#1945301, SF#1934832, BenBE)
+ - Introduced C-Style multiline continuation comments (SF#1914640, SF#1945301, BenBE)
+ - Introduced Fortran Comments (SF#1914640, SF#1934832, BenBE)
+ - Implemented Heredoc and Nowdoc Syntax for PHP and Perl (SF#1914640, BenBE)
+ - Implemented Compiler Directives for Delphi (SF#1914640, BenBE)
+ - Implemented minimalistic support for JavaScript \ Perl Regular Expressions (SF#1786665, SF#1754333, SF#1956631, BenBE)
+ - Fixed Strings in Matlab to be handled as comments instead of regexps, to prevent keywords being linked (BenBE)
+ - Applied PARSER_CONTROL fix of C++ for C++-Qt-Derivative (BenBE)
+ - Fixed incorrect treatment of unequally long multiline comment separators (related to SF #1891630, BenBE)
+ - Added PARSER_CONTROL settings for keywords in ASM language file (SF#1835148, BenBE)
+ - Fixed missing CASSE_SENSITIVE entry for DOS language file (SF#1956314, BenBE)
+ - Fixed accidential highlighting of keywords in argument names (SF#1956456, Milian Wolff, BenBE)
+ - Fixed yet again some #-related bash problem (SF#1956459, Milian Wolff, BenBE)
+ - Added backticks as symbols (Milian Wolff)
+ - Example script remembers selections and source submitted (Milian Wolff)
+ - Example script allows remembered source and preselected language to be cleared (Milian Wolff)
+ - Example script now properly includes geshi and doesn't suppress error messages anylonger. (Milian Wolff)
+ - Code cleanup by using direct string indexing instead of substr with length 1 (Milian Wolff)
+ - Optimized generation of code parts in strict mode (Milian Wolff)
+ - Optimized COMMENT_REGEXP by using an incremental regexp cache (Milian Wolff, BenBE)
+ - Fixed a problem that rarely skipped highlighting of escaped chars which usually should have gotten highlighted (BenBE)
+ - Optimized generation of highlighted strings to use fast skip forward while highlighting them (Milian Wolff, BenBE)
+ - Optimization using basic rework of indent function improving tab expansion performance (BenBE)
+ - Lots of other minor optimizations based on coding style improvements (Milian Wolff)
+ - Implemented setting to force spans to be closed before newlines, see SF#1727398 (Milian Wolff)
+ - Added missing credits for D language file to THANKS file (SF#1720899, BenBE)
+ - Optimization to prevent loading the current language file twice (Milian Wolff)
+ - Optimization: Use file_get_contents() to load sourcecode from files.
+ Even if GeSHi worked with PHP 4.1 before, it doesn't now. (Milian Wolff)
+ - Added description of extra language features (SF#1970248, BenBE)
+ - Added support for highlighting the C# using and namespace directives (SF #1395677, BenBE)
+ - Added support for highlighting the Java import and package directives (SF #1395677, BenBE)
+ - Fixed minor problem in Haskell cuasing accidential start of comment (SF#1987221, BenBE)
+ - Fixed minor issue causing loads of warnings if a language files defines no symbols (BenBE)
+ - Updated some aspects of the documentation and included further hints (BenBE)
+ - First of series of color scheme changes. Affected languages (sofar):
+ * Assembler (x86)
+ * Bash
+ * C
+ * C#
+ * Delphi
+ * Fortran77
+ * glSlang
+ * Java & Java 5
+ * JavaScript
+ * OCaml
+ * OpenOffice.org Basic
+ * Pascal
+ * Perl
+ * PHP and PHP-Brief
+Version 1.0.7.21
+ - Added language files
+ * Basic4GL (Matthew Webb)
+ - Fixed problem with mIRC language highlighting spaces only (BenBE)
+ - Language files can now specify a function to be called to decide the
+ colour of a regular expression match
+ - Added single quote to Lua (Darrin Roenfanz)
+ - Compare comments case insensitively (fixes AutoIT comments somewhat)
+ (Daniel Gordon)
+ - Fixed symbols not being highlighted at all (SF #1767953, BenBE)
+ - Fixed brackets not correctly managed (SF #1767954, BenBE)
+ - Changed default languages for some extensions
+ - Included color and character information for symbol highlighting in some languages (BenBE)
+ - Fixed a problem with extension detection if default was used (BenBE)
+ - Fixed a highlighting problem with the LaTeX language (SF #1776182, BenBE)
+ - Added a new parameter for enable_highlighting to reduce source duplication (SF #1786104, BenBE)
+ - Updated doxygen documentation to include since tags and some missing parameters
+ - Disabled symbol highlighting by default (doesn't affect brackets, cf. documentation) (BenBE)
+ - Added a check for set_case_keywords for the given param to be supported (BenBE)
+ - Minor rework of the HTML documentation layout \ W3C compliance (BenBE)
+ - Fixed highlighting error in bash language avoiding keywords in comments (SF #1786314, SF #1564839, BenBE)
+ - Fixed template params for C++ and C# not being highlighted (SF #1772919, BenBE)
+ - Fixed more reported problems about mirc highlighting
+ - Added some missing keywords for VB.NET
+ - Fixed some warnings in DOS language file (Florian Angehrn)
+ - Add possibility to handle more than one extra line style (SF #1698255, German Rumm, BenBE)
+ - Fixed handling of URLs when output case differs from URL case (SF #1815504, Tom Samstag, BenBE)
+ - Fixed POD (Plain Old Documentation) format problems breaking highlighting of Perl (SF #1891630, Shannon Wynter, BenBE)
+ - Fixed a problem with mIRC when & was used for identifiers (SF #1875552, BenBE)
+Version 1.0.7.20
+ - Added language files
+ * Genero (logic) and Per (forms) (FOURJ's Genero 4GL) (Lars Gersmann)
+ * Haskell (Dagit)
+ * ABAP (Andres Picazo)
+ * Motorola 68k Assembler (for MC68HC908GP32 Microcontroller) (BenBE)
+ * Dot (Adrien Friggeri)
+ - Fixed java documentation search for keywords to actually go to the
+ documentation (spaze)
+ - Applied fix for bug 1688864 (bad regexes) (Tim Starling)
+ - Fixed comment CSS rule in visualfoxpro
+ - ThinBASIC language update (Eros Olmi)
+ - mIRC language update (BenBE)
+ - Fixed outdated documentation URL of Perl language file (RuralMoon by BenBE)
+ - Fixed tab replacement code not generating the correct number of spaces in
+ some cases (Guillermo Calvo)
+ - Fixed two typos in Z80 language file
+ - Applied fix for bug 1730168 (Daniel Naber)
+ - Applied fix for bug 1705482 (Jason Frame)
+ * Configurable line endings (Replace \n by custom string)
+ * per-language tab-widths (Adjustable for width>=1)
+ * Included defaults for ASM (x86, m68k, z80), C, C (Mac), C++, C++ (Qt), C#,
+ Delphi, CSS,, HTML, PHP, PHP (Brief), QBasic, Ruby, XML
+ - Added a possibility to force generation of a surrounding tag around
+ the highlighted source
+ - Applied fix for additional keywords for the bash language
+ (cf. http://bash.thefreebizhost.com/bash_geshi.php, BenBE / Jan G)
+ - Fix bad colour definition in GML language (Andreas Gohr)
+ - Fixed phpdoc comments not being indented one space if they should be (Andy
+ Hassall)
+Version 1.0.7.19
+ - Added language files
+ * X++ (Simon Butcher)
+ * Rails (Moises Deniz)
+ - Fixed invalid HTML being generated and doctypes not being highlighted over
+ multiple lines properly when line numbers are on (Validome)
+ - Improved the ruby syntax highlighting by basing it off the Rails file
+ - Changed some regular expressions to possibly help with badly performing
+ regex support in PHP (Tim Starling)
+ - Allow {TIME}, {LANGUAGE} and {VERSION} to be used in the header as well as
+ the normal