summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2007-02-26 19:00:35 +0100
committerAndreas Gohr <andi@splitbrain.org>2007-02-26 19:00:35 +0100
commitbd3f1f0ac0ddbf58f8c4ec3213098093dd657612 (patch)
tree674ca7f34ed49452c7536ca65fcbb0d3b47bad1d /inc
parentadb16d4f36e6e2cfb75ce8c8d42724c7705dfe3c (diff)
downloadrpg-bd3f1f0ac0ddbf58f8c4ec3213098093dd657612.tar.gz
rpg-bd3f1f0ac0ddbf58f8c4ec3213098093dd657612.tar.bz2
GeSHi update to 1.0.7.18
darcs-hash:20070226180035-7ad00-c73a6af59b915e2930c6f56a23d374478a63f87d.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/geshi.php3742
-rw-r--r--inc/geshi/actionscript.php4
-rw-r--r--inc/geshi/ada.php4
-rw-r--r--inc/geshi/apache.php4
-rw-r--r--inc/geshi/applescript.php4
-rw-r--r--inc/geshi/asm.php4
-rw-r--r--inc/geshi/asp.php4
-rw-r--r--inc/geshi/autoit.php568
-rw-r--r--inc/geshi/bash.php4
-rw-r--r--inc/geshi/blitzbasic.php6
-rw-r--r--inc/geshi/bnf.php4
-rw-r--r--inc/geshi/c.php4
-rw-r--r--inc/geshi/c_mac.php4
-rw-r--r--inc/geshi/caddcl.php4
-rw-r--r--inc/geshi/cadlisp.php4
-rw-r--r--inc/geshi/cfdg.php4
-rw-r--r--inc/geshi/cfm.php4
-rw-r--r--inc/geshi/cpp-qt.php4
-rw-r--r--inc/geshi/cpp.php4
-rw-r--r--inc/geshi/csharp.php4
-rw-r--r--inc/geshi/css.php4
-rw-r--r--inc/geshi/d.php4
-rw-r--r--inc/geshi/delphi.php4
-rw-r--r--inc/geshi/diff.php4
-rw-r--r--inc/geshi/div.php4
-rw-r--r--inc/geshi/dos.php4
-rw-r--r--inc/geshi/eiffel.php4
-rw-r--r--inc/geshi/fortran.php4
-rw-r--r--inc/geshi/freebasic.php2
-rw-r--r--inc/geshi/gml.php4
-rw-r--r--inc/geshi/groovy.php4
-rw-r--r--inc/geshi/html4strict.php4
-rw-r--r--inc/geshi/idl.php4
-rw-r--r--inc/geshi/ini.php4
-rw-r--r--inc/geshi/inno.php4
-rw-r--r--inc/geshi/io.php4
-rw-r--r--inc/geshi/java.php4
-rw-r--r--inc/geshi/java5.php4
-rw-r--r--inc/geshi/javascript.php4
-rw-r--r--inc/geshi/lisp.php4
-rw-r--r--inc/geshi/lua.php4
-rw-r--r--inc/geshi/matlab.php4
-rw-r--r--inc/geshi/mirc.php4
-rw-r--r--inc/geshi/mpasm.php4
-rw-r--r--inc/geshi/mysql.php4
-rw-r--r--inc/geshi/nsis.php4
-rw-r--r--inc/geshi/objc.php4
-rw-r--r--inc/geshi/ocaml-brief.php4
-rw-r--r--inc/geshi/ocaml.php4
-rw-r--r--inc/geshi/oobas.php4
-rw-r--r--inc/geshi/oracle8.php4
-rw-r--r--inc/geshi/pascal.php4
-rw-r--r--inc/geshi/perl.php4
-rw-r--r--inc/geshi/php-brief.php4
-rw-r--r--inc/geshi/php.php4
-rw-r--r--inc/geshi/plsql.php4
-rw-r--r--inc/geshi/python.php6
-rw-r--r--inc/geshi/qbasic.php4
-rw-r--r--inc/geshi/reg.php4
-rw-r--r--inc/geshi/robots.php6
-rw-r--r--inc/geshi/ruby.php4
-rw-r--r--inc/geshi/sas.php4
-rw-r--r--inc/geshi/scheme.php4
-rw-r--r--inc/geshi/sdlbasic.php4
-rw-r--r--inc/geshi/smalltalk.php4
-rw-r--r--inc/geshi/smarty.php4
-rw-r--r--inc/geshi/sql.php4
-rw-r--r--inc/geshi/tcl.php4
-rw-r--r--inc/geshi/text.php4
-rw-r--r--inc/geshi/thinbasic.php4
-rw-r--r--inc/geshi/tsql.php4
-rw-r--r--inc/geshi/vb.php4
-rw-r--r--inc/geshi/vbnet.php4
-rw-r--r--inc/geshi/vhdl.php4
-rw-r--r--inc/geshi/visualfoxpro.php4
-rw-r--r--inc/geshi/winbatch.php4
-rw-r--r--inc/geshi/xml.php4
-rw-r--r--inc/geshi/z80.php133
78 files changed, 2539 insertions, 2208 deletions
diff --git a/inc/geshi.php b/inc/geshi.php
index 552f6e01a..f8d8b36d8 100644
--- a/inc/geshi.php
+++ b/inc/geshi.php
@@ -1,7 +1,7 @@
<?php
/**
* GeSHi - Generic Syntax Highlighter
- *
+ *
* The GeSHi class for Generic Syntax Highlighting. Please refer to the
* documentation at http://qbnz.com/highlighter/documentation.php for more
* information about how to use this class.
@@ -24,12 +24,12 @@
* You should have received a copy of the GNU General Public License
* along with GeSHi; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package core
- * @author Nigel McNie <nigel@geshi.org>
- * @copyright Copyright &copy; 2004, 2005, Nigel McNie
- * @license http://gnu.org/copyleft/gpl.html GNU GPL
- * @version $Id: geshi.php 873 2006-12-27 13:14:20Z oracleshinoda $
+ *
+ * @package geshi
+ * @subpackage core
+ * @author Nigel McNie <nigel@geshi.org>
+ * @copyright (C) 2004 - 2007 Nigel McNie
+ * @license http://gnu.org/copyleft/gpl.html GNU GPL
*
*/
@@ -41,7 +41,7 @@
//
/** The version of this GeSHi file */
-define('GESHI_VERSION', '1.0.7.17');
+define('GESHI_VERSION', '1.0.7.18');
// Define the root directory for the GeSHi code tree
if (!defined('GESHI_ROOT')) {
@@ -116,10 +116,10 @@ define('GESHI_REPLACE', 1);
/** The key of the regex array defining any modifiers to the regular expression */
define('GESHI_MODIFIERS', 2);
/** The key of the regex array defining what bracket group in a
- matched search to put before the replacement */
+ matched search to put before the replacement */
define('GESHI_BEFORE', 3);
/** The key of the regex array defining what bracket group in a
- matched search to put after the replacement */
+ matched search to put after the replacement */
define('GESHI_AFTER', 4);
/** The key of the regex array defining a custom keyword to use
for this regexp's html tag class */
@@ -150,13 +150,12 @@ define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5);
* Please refer to the documentation for GeSHi 1.0.X that is available
* at http://qbnz.com/highlighter/documentation.php for more information
* about how to use this class.
- *
- * @package core
+ *
+ * @package geshi
* @author Nigel McNie <nigel@geshi.org>
- * @copyright Copyright &copy; 2004, 2005 Nigel McNie
+ * @copyright (C) 2004 - 2007 Nigel McNie
*/
-class GeSHi
-{
+class GeSHi {
/**#@+
* @access private
*/
@@ -164,78 +163,73 @@ class GeSHi
* The source code to highlight
* @var string
*/
- var $source = '';
-
+ var $source = '';
+
/**
* The language to use when highlighting
* @var string
*/
- var $language = '';
-
+ var $language = '';
+
/**
* The data for the language used
* @var array
*/
- var $language_data = array();
-
+ var $language_data = array();
+
/**
* The path to the language files
* @var string
*/
- var $language_path = GESHI_LANG_ROOT;
-
+ var $language_path = GESHI_LANG_ROOT;
+
/**
* The error message associated with an error
* @var string
* @todo check err reporting works
*/
- var $error = false;
-
+ var $error = false;
+
/**
* Possible error messages
* @var array
*/
var $error_messages = array(
- //GESHI_ERROR_NO_INPUT => 'No source code inputted',
GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})',
GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable',
GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid',
GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid'
);
-
+
/**
* Whether highlighting is strict or not
* @var boolean
*/
- var $strict_mode = false;
-
+ var $strict_mode = false;
+
/**
* Whether to use CSS classes in output
* @var boolean
*/
- var $use_classes = false;
-
+ var $use_classes = false;
+
/**
* The type of header to use. Can be one of the following
* values:
- *
- * <ul>
- * <li><b>GESHI_HEADER_PRE</b>: Source is outputted in
- * a &lt;pre&gt; HTML element.</li>
- * <li><b>GESHI_HEADER_DIV</b>: Source is outputted in
- * a &lt;div&gt; HTML element.</li>
- * <li><b>GESHI_HEADER_NONE</b>: No header is outputted.</li>
- * </ul>
- *
+ *
+ * - GESHI_HEADER_PRE: Source is outputted in a "pre" HTML element.
+ * - GESHI_HEADER_DIV: Source is outputted in a "div" HTML element.
+ * - GESHI_HEADER_NONE: No header is outputted.
+ *
* @var int
*/
- var $header_type = GESHI_HEADER_PRE;
-
+ var $header_type = GESHI_HEADER_PRE;
+
/**
* Array of permissions for which lexics should be highlighted
* @var array
*/
- var $lexic_permissions = array(
+ var $lexic_permissions = array(
'KEYWORDS' => array(),
'COMMENTS' => array('MULTI' => true),
'REGEXPS' => array(),
@@ -253,45 +247,45 @@ class GeSHi
* @var double
*/
var $time = 0;
-
+
/**
* The content of the header block
* @var string
*/
- var $header_content = '';
-
+ var $header_content = '';
+
/**
* The content of the footer block
* @var string
*/
- var $footer_content = '';
-
+ var $footer_content = '';
+
/**
* The style of the header block
* @var string
*/
- var $header_content_style = '';
-
+ var $header_content_style = '';
+
/**
* The style of the footer block
* @var string
*/
- var $footer_content_style = '';
-
+ var $footer_content_style = '';
+
/**
* The styles for hyperlinks in the code
* @var array
*/
- var $link_styles = array();
-
+ var $link_styles = array();
+
/**
* Whether important blocks should be recognised or not
* @var boolean
* @deprecated
* @todo REMOVE THIS FUNCTIONALITY!
*/
- var $enable_important_blocks = false;
-
+ var $enable_important_blocks = false;
+
/**
* Styles for important parts of the code
* @var string
@@ -299,104 +293,110 @@ class GeSHi
* @todo As above - rethink the whole idea of important blocks as it is buggy and
* will be hard to implement in 1.2
*/
- var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
-
+ var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
+
/**
* Whether CSS IDs should be added to the code
* @var boolean
*/
- var $add_ids = false;
-
+ var $add_ids = false;
+
/**
* Lines that should be highlighted extra
* @var array
*/
- var $highlight_extra_lines = array();
-
+ var $highlight_extra_lines = array();
+
/**
* Styles of extra-highlighted lines
* @var string
*/
- var $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;';
-
+ var $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;';
+
/**
* Number at which line numbers should start at
* @var int
- * @todo Warning documentation about XHTML compliance
*/
- var $line_numbers_start = 1;
+ var $line_numbers_start = 1;
- /**
+ /**
* The overall style for this code block
* @var string
- */
- var $overall_style = '';
-
+ */
+ var $overall_style = '';
+
/**
* The style for the actual code
* @var string
*/
- var $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal;';
-
+ var $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal;';
+
/**
* The overall class for this code block
* @var string
*/
- var $overall_class = '';
-
+ var $overall_class = '';
+
/**
* The overall ID for this code block
* @var string
*/
- var $overall_id = '';
-
- /**
+ var $overall_id = '';
+
+ /**
* Line number styles
* @var string
*/
- var $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;';
-
+ var $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;';
+
/**
* Line number styles for fancy lines
* @var string
*/
- var $line_style2 = 'font-weight: bold;';
-
+ var $line_style2 = 'font-weight: bold;';
+
/**
* Flag for how line nubmers are displayed
* @var boolean
*/
- var $line_numbers = GESHI_NO_LINE_NUMBERS;
-
+ var $line_numbers = GESHI_NO_LINE_NUMBERS;
+
/**
* The "nth" value for fancy line highlighting
* @var int
*/
- var $line_nth_row = 0;
+ var $line_nth_row = 0;
- /**
+ /**
* The size of tab stops
* @var int
- */
- var $tab_width = 8;
-
+ */
+ var $tab_width = 8;
+
/**
* Default target for keyword links
* @var string
*/
- var $link_target = '';
-
+ var $link_target = '';
+
/**
* The encoding to use for entity encoding
+ * NOTE: no longer used
* @var string
*/
- var $encoding = 'ISO-8859-1';
+ var $encoding = 'ISO-8859-1';
+
+ /**
+ * Should keywords be linked?
+ * @var boolean
+ */
+ var $keyword_links = true;
/**#@-*/
- /**
- * Creates a new GeSHi object, with source and language
- *
+ /**
+ * Creates a new GeSHi object, with source and language
+ *
* @param string The source code to highlight
* @param string The language to highlight the source with
* @param string The path to the language file directory. <b>This
@@ -407,215 +407,205 @@ class GeSHi
* still need to set the path using this parameter or
* {@link GeSHi::set_language_path()}
* @since 1.0.0
- */
- function GeSHi ($source, $language, $path = '')
- {
+ */
+ function GeSHi($source, $language, $path = '') {
$this->set_source($source);
$this->set_language_path($path);
$this->set_language($language);
- }
+ }
- /**
- * Returns an error message associated with the last GeSHi operation,
- * or false if no error has occured
- *
+ /**
+ * Returns an error message associated with the last GeSHi operation,
+ * or false if no error has occured
+ *
* @return string|false An error message if there has been an error, else false
* @since 1.0.0
- */
- function error ()
- {
- if ($this->error) {
- $msg = $this->error_messages[$this->error];
- $debug_tpl_vars = array(
- '{LANGUAGE}' => $this->language,
- '{PATH}' => $this->language_path
- );
- foreach ($debug_tpl_vars as $tpl => $var) {
- $msg = str_replace($tpl, $var, $msg);
- }
- return "<br /><strong>GeSHi Error:</strong> $msg (code $this->error)<br />";
- }
- return false;
- }
-
- /**
- * Gets a human-readable language name (thanks to Simon Patterson
- * for the idea :))
- *
+ */
+ function error() {
+ if ($this->error) {
+ $msg = $this->error_messages[$this->error];
+ $debug_tpl_vars = array(
+ '{LANGUAGE}' => $this->language,
+ '{PATH}' => $this->language_path
+ );
+ foreach ($debug_tpl_vars as $tpl => $var) {
+ $msg = str_replace($tpl, $var, $msg);
+ }
+ return "<br /><strong>GeSHi Error:</strong> $msg (code $this->error)<br />";
+ }
+ return false;
+ }
+
+ /**
+ * Gets a human-readable language name (thanks to Simon Patterson
+ * for the idea :))
+ *
* @return string The name for the current language
* @since 1.0.2
- */
- function get_language_name ()
- {
- if (GESHI_ERROR_NO_SUCH_LANG == $this->error) {
- return $this->language_data['LANG_NAME'] . ' (Unknown Language)';
- }
- return $this->language_data['LANG_NAME'];
- }
-
- /**
- * Sets the source code for this object
- *
+ */
+ function get_language_name() {
+ if (GESHI_ERROR_NO_SUCH_LANG == $this->error) {
+ return $this->language_data['LANG_NAME'] . ' (Unknown Language)';
+ }
+ return $this->language_data['LANG_NAME'];
+ }
+
+ /**
+ * Sets the source code for this object
+ *
* @param string The source code to highlight
* @since 1.0.0
- */
- function set_source ($source)
- {
- $this->source = $source;
+ */
+ function set_source($source) {
+ $this->source = $source;
$this->highlight_extra_lines = array();
- }
+ }
- /**
- * Sets the language for this object
- *
+ /**
+ * Sets the language for this object
+ *
* @param string The name of the language to use
* @since 1.0.0
- */
- function set_language ($language)
- {
+ */
+ function set_language($language) {
$this->error = false;
$this->strict_mode = GESHI_NEVER;
-
- $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
- $this->language = strtolower($language);
-
+
+ $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
+ $this->language = strtolower($language);
+
$file_name = $this->language_path . $this->language . '.php';
if (!is_readable($file_name)) {
$this->error = GESHI_ERROR_NO_SUCH_LANG;
return;
}
- // Load the language for parsing
- $this->load_language($file_name);
- }
+ // Load the language for parsing
+ $this->load_language($file_name);
+ }
- /**
- * Sets the path to the directory containing the language files. Note
- * that this path is relative to the directory of the script that included
- * geshi.php, NOT geshi.php itself.
- *
+ /**
+ * Sets the path to the directory containing the language files. Note
+ * that this path is relative to the directory of the script that included
+ * geshi.php, NOT geshi.php itself.
+ *
* @param string The path to the language directory
* @since 1.0.0
* @deprecated The path to the language files should now be automatically
* detected, so this method should no longer be needed. The
* 1.1.X branch handles manual setting of the path differently
* so this method will disappear in 1.2.0.
- */
- function set_language_path ($path)
- {
+ */
+ function set_language_path($path) {
if ($path) {
- $this->language_path = ('/' == substr($path, strlen($path) - 1, 1)) ? $path : $path . '/';
- $this->set_language($this->language); // otherwise set_language_path has no effect
+ $this->language_path = ('/' == substr($path, strlen($path) - 1, 1)) ? $path : $path . '/';
+ $this->set_language($this->language); // otherwise set_language_path has no effect
}
- }
+ }
- /**
- * Sets the type of header to be used.
- *
+ /**
+ * Sets the type of header to be used.
+ *
* If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
* means more source code but more control over tab width and line-wrapping.
* GESHI_HEADER_PRE means that a "pre" is used - less source, but less
* control. Default is GESHI_HEADER_PRE.
- *
+ *
* From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
* should be outputted.
- *
+ *
* @param int The type of header to be used
* @since 1.0.0
- */
- function set_header_type ($type)
- {
+ */
+ function set_header_type($type) {
if (GESHI_HEADER_DIV != $type && GESHI_HEADER_PRE != $type && GESHI_HEADER_NONE != $type) {
$this->error = GESHI_ERROR_INVALID_HEADER_TYPE;
return;
}
- $this->header_type = $type;
+ $this->header_type = $type;
// Set a default overall style if the header is a <div>
if (GESHI_HEADER_DIV == $type && !$this->overall_style) {
$this->overall_style = 'font-family: monospace;';
}
- }
+ }
- /**
- * Sets the styles for the code that will be outputted
- * when this object is parsed. The style should be a
- * string of valid stylesheet declarations
- *
+ /**
+ * Sets the styles for the code that will be outputted
+ * when this object is parsed. The style should be a
+ * string of valid stylesheet declarations
+ *
* @param string The overall style for the outputted code block
* @param boolean Whether to merge the styles with the current styles or not
* @since 1.0.0
- */
- function set_overall_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->overall_style = $style;
- } else {
- $this->overall_style .= $style;
- }
- }
-
- /**
- * Sets the overall classname for this block of code. This
- * class can then be used in a stylesheet to style this object's
- * output
- *
+ */
+ function set_overall_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->overall_style = $style;
+ }
+ else {
+ $this->overall_style .= $style;
+ }
+ }
+
+ /**
+ * Sets the overall classname for this block of code. This
+ * class can then be used in a stylesheet to style this object's
+ * output
+ *
* @param string The class name to use for this block of code
* @since 1.0.0
- */
- function set_overall_class ($class)
- {
- $this->overall_class = $class;
- }
-
- /**
- * Sets the overall id for this block of code. This id can then
- * be used in a stylesheet to style this object's output
- *
+ */
+ function set_overall_class($class) {
+ $this->overall_class = $class;
+ }
+
+ /**
+ * Sets the overall id for this block of code. This id can then
+ * be used in a stylesheet to style this object's output
+ *
* @param string The ID to use for this block of code
* @since 1.0.0
- */
- function set_overall_id ($id)
- {
+ */
+ function set_overall_id($id) {
$this->overall_id = $id;
- }
+ }
- /**
+ /**
* Sets whether CSS classes should be used to highlight the source. Default
* is off, calling this method with no arguments will turn it on
- *
+ *
* @param boolean Whether to turn classes on or not
* @since 1.0.0
*/
- function enable_classes ($flag = true)
- {
- $this->use_classes = ($flag) ? true : false;
- }
-
- /**
- * Sets the style for the actual code. This should be a string
- * containing valid stylesheet declarations. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * Note: Use this method to override any style changes you made to
- * the line numbers if you are using line numbers, else the line of
- * code will have the same style as the line number! Consult the
- * GeSHi documentation for more information about this.
- *
+ function enable_classes($flag = true) {
+ $this->use_classes = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the style for the actual code. This should be a string
+ * containing valid stylesheet declarations. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
+ * Note: Use this method to override any style changes you made to
+ * the line numbers if you are using line numbers, else the line of
+ * code will have the same style as the line number! Consult the
+ * GeSHi documentation for more information about this.
+ *
* @param string The style to use for actual code
* @param boolean Whether to merge the current styles with the new styles
- */
- function set_code_style ($style, $preserve_defaults = false)
- {
+ */
+ function set_code_style($style, $preserve_defaults = false) {
if (!$preserve_defaults) {
$this->code_style = $style;
- } else {
+ }
+ else {
$this->code_style .= $style;
}
}
- /**
- * Sets the styles for the line numbers.
- *
+ /**
+ * Sets the styles for the line numbers.
+ *
* @param string The style for the line numbers that are "normal"
* @param string|boolean If a string, this is the style of the line
* numbers that are "fancy", otherwise if boolean then this
@@ -624,741 +614,707 @@ class GeSHi
* @param boolean If set, is the flag for whether to merge the "fancy"
* styles with the current styles or not
* @since 1.0.2
- */
- function set_line_style ($style1, $style2 = '', $preserve_defaults = false)
- {
- if (is_bool($style2)) {
- $preserve_defaults = $style2;
- $style2 = '';
- }
- if (!$preserve_defaults) {
- $this->line_style1 = $style1;
- $this->line_style2 = $style2;
- } else {
- $this->line_style1 .= $style1;
- $this->line_style2 .= $style2;
- }
- }
-
- /**
- * Sets whether line numbers should be displayed.
- *
+ */
+ function set_line_style($style1, $style2 = '', $preserve_defaults = false) {
+ if (is_bool($style2)) {
+ $preserve_defaults = $style2;
+ $style2 = '';
+ }
+ if (!$preserve_defaults) {
+ $this->line_style1 = $style1;
+ $this->line_style2 = $style2;
+ }
+ else {
+ $this->line_style1 .= $style1;
+ $this->line_style2 .= $style2;
+ }
+ }
+
+ /**
+ * Sets whether line numbers should be displayed.
+ *
* Valid values for the first parameter are:
- *
- * <ul>
- * <li><b>GESHI_NO_LINE_NUMBERS</b>: Line numbers will not be displayed</li>
- * <li><b>GESHI_NORMAL_LINE_NUMBERS</b>: Line numbers will be displayed</li>
- * <li><b>GESHI_FANCY_LINE_NUMBERS</b>: Fancy line numbers will be displayed</li>
- * </ul>
- *
+ *
+ * - GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed
+ * - GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed
+ * - GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed
+ *
* For fancy line numbers, the second parameter is used to signal which lines
* are to be fancy. For example, if the value of this parameter is 5 then every
* 5th line will be fancy.
- *
+ *
* @param int How line numbers should be displayed
* @param int Defines which lines are fancy
* @since 1.0.0
- */
- function enable_line_numbers ($flag, $nth_row = 5)
- {
+ */
+ function enable_line_numbers($flag, $nth_row = 5) {
if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag
&& GESHI_FANCY_LINE_NUMBERS != $flag) {
$this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE;
}
- $this->line_numbers = $flag;
- $this->line_nth_row = $nth_row;
- }
+ $this->line_numbers = $flag;
+ $this->line_nth_row = $nth_row;
+ }
- /**
- * Sets the style for a keyword group. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ /**
+ * Sets the style for a keyword group. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param int The key of the keyword group to change the styles of
* @param string The style to make the keywords
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_keyword_group_style ($key, $style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for a keyword group
- *
+ */
+ function set_keyword_group_style($key, $style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for a keyword group
+ *
* @param int The key of the keyword group to turn on or off
* @param boolean Whether to turn highlighting for that group on or off
* @since 1.0.0
- */
- function set_keyword_group_highlighting ( $key, $flag = true )
- {
- $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for comment groups. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_keyword_group_highlighting($key, $flag = true) {
+ $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for comment groups. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param int The key of the comment group to change the styles of
* @param string The style to make the comments
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_comments_style ($key, $style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['COMMENTS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for comment groups
- *
+ */
+ function set_comments_style($key, $style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['COMMENTS'][$key] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for comment groups
+ *
* @param int The key of the comment group to turn on or off
* @param boolean Whether to turn highlighting for that group on or off
* @since 1.0.0
- */
- function set_comments_highlighting ($key, $flag = true)
- {
- $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for escaped characters. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_comments_highlighting($key, $flag = true) {
+ $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for escaped characters. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param string The style to make the escape characters
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_escape_characters_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['ESCAPE_CHAR'][0] = $style;
- } else {
- $this->language_data['STYLES']['ESCAPE_CHAR'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for escaped characters
- *
+ */
+ function set_escape_characters_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['ESCAPE_CHAR'][0] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['ESCAPE_CHAR'][0] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for escaped characters
+ *
* @param boolean Whether to turn highlighting for escape characters on or off
* @since 1.0.0
- */
- function set_escape_characters_highlighting ($flag = true)
- {
- $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for brackets. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * This method is DEPRECATED: use set_symbols_style instead.
- * This method will be removed in 1.2.X
- *
+ */
+ function set_escape_characters_highlighting($flag = true) {
+ $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for brackets. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
+ * This method is DEPRECATED: use set_symbols_style instead.
+ * This method will be removed in 1.2.X
+ *
* @param string The style to make the brackets
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
* @deprecated In favour of set_symbols_style
- */
- function set_brackets_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['BRACKETS'][0] = $style;
- } else {
- $this->language_data['STYLES']['BRACKETS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for brackets
- *
- * This method is DEPRECATED: use set_symbols_highlighting instead.
- * This method will be remove in 1.2.X
- *
+ */
+ function set_brackets_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['BRACKETS'][0] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['BRACKETS'][0] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for brackets
+ *
+ * This method is DEPRECATED: use set_symbols_highlighting instead.
+ * This method will be remove in 1.2.X
+ *
* @param boolean Whether to turn highlighting for brackets on or off
* @since 1.0.0
* @deprecated In favour of set_symbols_highlighting
- */
- function set_brackets_highlighting ($flag)
- {
- $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for symbols. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_brackets_highlighting($flag) {
+ $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for symbols. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param string The style to make the symbols
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.1
- */
- function set_symbols_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['SYMBOLS'][0] = $style;
- } else {
- $this->language_data['STYLES']['SYMBOLS'][0] .= $style;
- }
- // For backward compatibility
- $this->set_brackets_style ($style, $preserve_defaults);
- }
-
- /**
- * Turns highlighting on/off for symbols
- *
+ */
+ function set_symbols_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['SYMBOLS'][0] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['SYMBOLS'][0] .= $style;
+ }
+ // For backward compatibility
+ $this->set_brackets_style ($style, $preserve_defaults);
+ }
+
+ /**
+ * Turns highlighting on/off for symbols
+ *
* @param boolean Whether to turn highlighting for symbols on or off
* @since 1.0.0
- */
- function set_symbols_highlighting ($flag)
- {
- $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
- // For backward compatibility
- $this->set_brackets_highlighting ($flag);
- }
-
- /**
- * Sets the styles for strings. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_symbols_highlighting($flag) {
+ $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
+ // For backward compatibility
+ $this->set_brackets_highlighting ($flag);
+ }
+
+ /**
+ * Sets the styles for strings. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param string The style to make the escape characters
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_strings_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['STRINGS'][0] = $style;
- } else {
- $this->language_data['STYLES']['STRINGS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for strings
- *
+ */
+ function set_strings_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['STRINGS'][0] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['STRINGS'][0] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for strings
+ *
* @param boolean Whether to turn highlighting for strings on or off
* @since 1.0.0
- */
- function set_strings_highlighting ($flag)
- {
- $this->lexic_permissions['STRINGS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for numbers. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_strings_highlighting($flag) {
+ $this->lexic_permissions['STRINGS'] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for numbers. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param string The style to make the numbers
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_numbers_style ($style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['NUMBERS'][0] = $style;
- } else {
- $this->language_data['STYLES']['NUMBERS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for numbers
- *
+ */
+ function set_numbers_style($style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['NUMBERS'][0] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['NUMBERS'][0] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for numbers
+ *
* @param boolean Whether to turn highlighting for numbers on or off
* @since 1.0.0
- */
- function set_numbers_highlighting ($flag)
- {
- $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for methods. $key is a number that references the
- * appropriate "object splitter" - see the language file for the language
- * you are highlighting to get this number. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_numbers_highlighting($flag) {
+ $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for methods. $key is a number that references the
+ * appropriate "object splitter" - see the language file for the language
+ * you are highlighting to get this number. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param int The key of the object splitter to change the styles of
* @param string The style to make the methods
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_methods_style ($key, $style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['METHODS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['METHODS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for methods
- *
+ */
+ function set_methods_style($key, $style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['METHODS'][$key] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['METHODS'][$key] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for methods
+ *
* @param boolean Whether to turn highlighting for methods on or off
* @since 1.0.0
- */
- function set_methods_highlighting ($flag)
- {
- $this->lexic_permissions['METHODS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for regexps. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
+ */
+ function set_methods_highlighting($flag) {
+ $this->lexic_permissions['METHODS'] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets the styles for regexps. If $preserve_defaults is
+ * true, then styles are merged with the default styles, with the
+ * user defined styles having priority
+ *
* @param string The style to make the regular expression matches
* @param boolean Whether to merge the new styles with the old or just
* to overwrite them
* @since 1.0.0
- */
- function set_regexps_style ($key, $style, $preserve_defaults = false)
- {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['REGEXPS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for regexps
- *
+ */
+ function set_regexps_style($key, $style, $preserve_defaults = false) {
+ if (!$preserve_defaults) {
+ $this->language_data['STYLES']['REGEXPS'][$key] = $style;
+ }
+ else {
+ $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
+ }
+ }
+
+ /**
+ * Turns highlighting on/off for regexps
+ *
* @param int The key of the regular expression group to turn on or off
* @param boolean Whether to turn highlighting for the regular expression group on or off
* @since 1.0.0
- */
- function set_regexps_highlighting ($key, $flag)
- {
- $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets whether a set of keywords are checked for in a case sensitive manner
- *
+ */
+ function set_regexps_highlighting($key, $flag) {
+ $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
+ }
+
+ /**
+ * Sets whether a set of keywords are checked for in a case sensitive manner
+ *
* @param int The key of the keyword group to change the case sensitivity of
* @param boolean Whether to check in a case sensitive manner or not
* @since 1.0.0
- */
- function set_case_sensitivity ($key, $case)
- {
- $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
- }
-
- /**
- * Sets the case that keywords should use when found. Use the constants:
- *
- * <ul>
- * <li><b>GESHI_CAPS_NO_CHANGE</b>: leave keywords as-is</li>
- * <li><b>GESHI_CAPS_UPPER</b>: convert all keywords to uppercase where found</li>
- * <li><b>GESHI_CAPS_LOWER</b>: convert all keywords to lowercase where found</li>
- * </ul>
- *
+ */
+ function set_case_sensitivity($key, $case) {
+ $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
+ }
+
+ /**
+ * Sets the case that keywords should use when found. Use the constants:
+ *
+ * - GESHI_CAPS_NO_CHANGE: leave keywords as-is
+ * - GESHI_CAPS_UPPER: convert all keywords to uppercase where found
+ * - GESHI_CAPS_LOWER: convert all keywords to lowercase where found
+ *
* @param int A constant specifying what to do with matched keywords
* @since 1.0.1
* @todo Error check the passed value
- */
- function set_case_keywords ($case)
- {
- $this->language_data['CASE_KEYWORDS'] = $case;
- }
-
- /**
- * Sets how many spaces a tab is substituted for
- *
+ */
+ function set_case_keywords($case) {
+ $this->language_data['CASE_KEYWORDS'] = $case;
+ }
+
+ /**
+ * Sets how many spaces a tab is substituted for
+ *
* Widths below zero are ignored
- *
+ *
* @param int The tab width
* @since 1.0.0
- */
- function set_tab_width ($width)
- {
- $this->tab_width = intval($width);
- }
-
- /**
- * Enables/disables strict highlighting. Default is off, calling this
- * method without parameters will turn it on. See documentation
- * for more details on strict mode and where to use it.
- *
+ */
+ function set_tab_width($width) {
+ $this->tab_width = intval($width);
+ }
+
+ /**
+ * Enables/disables strict highlighting. Default is off, calling this
+ * method without parameters will turn it on. See documentation
+ * for more details on strict mode and where to use it.
+ *
* @param boolean Whether to enable strict mode or not
* @since 1.0.0
- */
- function enable_strict_mode ($mode = true)
- {
+ */
+ function enable_strict_mode($mode = true) {
if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) {
- $this->strict_mode = ($mode) ? true : false;
+ $this->strict_mode = ($mode) ? true : false;
}
- }
+ }
- /**
- * Disables all highlighting
- *
+ /**
+ * Disables all highlighting
+ *
* @since 1.0.0
* @todo Rewrite with an array traversal
- */
- function disable_highlighting ()
- {
+ */
+ function disable_highlighting() {
foreach ($this->lexic_permissions as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$this->lexic_permissions[$key][$k] = false;
}
- } else {
+ }
+ else {
$this->lexic_permissions[$key] = false;
}
}
- // Context blocks
- $this->enable_important_blocks = false;
- }
+ // Context blocks
+ $this->enable_important_blocks = false;
+ }
- /**
- * Enables all highlighting
- *
+ /**
+ * Enables all highlighting
+ *
* @since 1.0.0
* @todo Rewrite with array traversal
- */
- function enable_highlighting ()
- {
+ */
+ function enable_highlighting() {
foreach ($this->lexic_permissions as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
$this->lexic_permissions[$key][$k] = true;
}
- } else {
+ }
+ else {
$this->lexic_permissions[$key] = true;
}
}
- // Context blocks
- $this->enable_important_blocks = true;
- }
+ // Context blocks
+ $this->enable_important_blocks = true;
+ }
- /**
- * Given a file extension, this method returns either a valid geshi language
- * name, or the empty string if it couldn't be found
- *
+ /**
+ * Given a file extension, this method returns either a valid geshi language
+ * name, or the empty string if it couldn't be found
+ *
* @param string The extension to get a language name for
* @param array A lookup array to use instead of the default
* @since 1.0.5
* @todo Re-think about how this method works (maybe make it private and/or make it
* a extension->lang lookup?)
* @todo static?
- */
- function get_language_name_from_extension ( $extension, $lookup = array() )
- {
- if ( !$lookup )
- {
- $lookup = array(
- 'actionscript' => array('as'),
- 'ada' => array('a', 'ada', 'adb', 'ads'),
- 'apache' => array('conf'),
- 'asm' => array('ash', 'asm'),
- 'asp' => array('asp'),
- 'bash' => array('sh'),
- 'c' => array('c', 'h'),
- 'c_mac' => array('c', 'h'),
- 'caddcl' => array(),
- 'cadlisp' => array(),
+ */
+ function get_language_name_from_extension( $extension, $lookup = array() ) {
+ if ( !$lookup ) {
+ $lookup = array(
+ 'actionscript' => array('as'),
+ 'ada' => array('a', 'ada', 'adb', 'ads'),
+ 'apache' => array('conf'),
+ 'asm' => array('ash', 'asm'),
+ 'asp' => array('asp'),
+ 'bash' => array('sh'),
+ 'c' => array('c', 'h'),
+ 'c_mac' => array('c', 'h'),
+ 'caddcl' => array(),
+ 'cadlisp' => array(),
'cdfg' => array('cdfg'),
- 'cpp' => array('cpp', 'h', 'hpp'),
- 'csharp' => array(),
- 'css' => array('css'),
- 'delphi' => array('dpk', 'dpr'),
- 'html4strict' => array('html', 'htm'),
- 'java' => array('java'),
- 'javascript' => array('js'),
- 'lisp' => array('lisp'),
- 'lua' => array('lua'),
- 'mpasm' => array(),
- 'nsis' => array(),
- 'objc' => array(),
- 'oobas' => array(),
- 'oracle8' => array(),
- 'pascal' => array('pas'),
- 'perl' => array('pl', 'pm'),
- 'php' => array('php', 'php5', 'phtml', 'phps'),
- 'python' => array('py'),
- 'qbasic' => array('bi'),
+ 'cpp' => array('cpp', 'h', 'hpp'),
+ 'csharp' => array(),
+ 'css' => array('css'),
+ 'delphi' => array('dpk', 'dpr'),
+ 'html4strict' => array('html', 'htm'),
+ 'java' => array('java'),
+ 'javascript' => array('js'),
+ 'lisp' => array('lisp'),
+ 'lua' => array('lua'),
+ 'mpasm' => array(),
+ 'nsis' => array(),
+ 'objc' => array(),
+ 'oobas' => array(),
+ 'oracle8' => array(),
+ 'pascal' => array('pas'),
+ 'perl' => array('pl', 'pm'),
+ 'php' => array('php', 'php5', 'phtml', 'phps'),
+ 'python' => array('py'),
+ 'qbasic' => array('bi'),
'sas' => array('sas'),
- 'smarty' => array(),
- 'vb' => array('bas'),
- 'vbnet' => array(),
- 'visualfoxpro' => array(),
- 'xml' => array('xml')
- );
- }
-
- foreach ($lookup as $lang => $extensions) {
- foreach ($extensions as $ext) {
- if ($ext == $extension) {
- return $lang;
- }
- }
- }
- return '';
- }
-
- /**
- * Given a file name, this method loads its contents in, and attempts
- * to set the language automatically. An optional lookup table can be
- * passed for looking up the language name. If not specified a default
+ 'smarty' => array(),
+ 'vb' => array('bas'),
+ 'vbnet' => array(),
+ 'visualfoxpro' => array(),
+ 'xml' => array('xml')
+ );
+ }
+
+ foreach ($lookup as $lang => $extensions) {
+ foreach ($extensions as $ext) {
+ if ($ext == $extension) {
+ return $lang;
+ }
+ }
+ }
+ return '';
+ }
+
+ /**
+ * Given a file name, this method loads its contents in, and attempts
+ * to set the language automatically. An optional lookup table can be
+ * passed for looking up the language name. If not specified a default
* table is used
- *
- * The language table is in the form
- * <pre>array(
- * 'lang_name' => array('extension', 'extension', ...),
- * 'lang_name' ...
- * );</pre>
- *
+ *
+ * The language table is in the form
+ * <pre>array(
+ * 'lang_name' => array('extension', 'extension', ...),
+ * 'lang_name' ...
+ * );</pre>
+ *
* @todo Complete rethink of this and above method
* @since 1.0.5
- */
- function load_from_file ($file_name, $lookup = array())
- {
- if (is_readable($file_name)) {
- $this->set_source(implode('', file($file_name)));
- $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup));
- } else {
- $this->error = GESHI_ERROR_FILE_NOT_READABLE;
- }
- }
-
- /**
- * Adds a keyword to a keyword group for highlighting
- *
+ */
+ function load_from_file($file_name, $lookup = array()) {
+ if (is_readable($file_name)) {
+ $this->set_source(implode('', file($file_name)));
+ $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup));
+ }
+ else {
+ $this->error = GESHI_ERROR_FILE_NOT_READABLE;
+ }
+ }
+
+ /**
+ * Adds a keyword to a keyword group for highlighting
+ *
* @param int The key of the keyword group to add the keyword to
* @param string The word to add to the keyword group
- * @since 1.0.0
- */
- function add_keyword ($key, $word)
- {
- $this->language_data['KEYWORDS'][$key][] = $word;
- }
-
- /**
- * Removes a keyword from a keyword group
- *
+ * @since 1.0.0
+ */
+ function add_keyword($key, $word) {
+ $this->language_data['KEYWORDS'][$key][] = $word;
+ }
+
+ /**
+ * Removes a keyword from a keyword group
+ *
* @param int The key of the keyword group to remove the keyword from
* @param string The word to remove from the keyword group
- * @since 1.0.0
- */
- function remove_keyword ($key, $word)
- {
- $this->language_data['KEYWORDS'][$key] =
+ * @since 1.0.0
+ */
+ function remove_keyword($key, $word) {
+ $this->language_data['KEYWORDS'][$key] =
array_diff($this->language_data['KEYWORDS'][$key], array($word));
- }
+ }
- /**
- * Creates a new keyword group
- *
+ /**
+ * Creates a new keyword group
+ *
* @param int The key of the keyword group to create
* @param string The styles for the keyword group
* @param boolean Whether the keyword group is case sensitive ornot
* @param array The words to use for the keyword group
- * @since 1.0.0
- */
- function add_keyword_group ( $key, $styles, $case_sensitive = true, $words = array() )
- {
+ * @since 1.0.0
+ */
+ function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
$words = (array) $words;
- $this->language_data['KEYWORDS'][$key] = $words;
- $this->lexic_permissions['KEYWORDS'][$key] = true;
- $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
- $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
- }
-
- /**
- * Removes a keyword group
- *
+ $this->language_data['KEYWORDS'][$key] = $words;
+ $this->lexic_permissions['KEYWORDS'][$key] = true;
+ $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
+ $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
+ }
+
+ /**
+ * Removes a keyword group
+ *
* @param int The key of the keyword group to remove
- * @since 1.0.0
- */
- function remove_keyword_group ($key)
- {
- unset($this->language_data['KEYWORDS'][$key]);
- unset($this->lexic_permissions['KEYWORDS'][$key]);
- unset($this->language_data['CASE_SENSITIVE'][$key]);
- unset($this->language_data['STYLES']['KEYWORDS'][$key]);
- }
-
- /**
- * Sets the content of the header block
- *
+ * @since 1.0.0
+ */
+ function remove_keyword_group ($key) {
+ unset($this->language_data['KEYWORDS'][$key]);
+ unset($this->lexic_permissions['KEYWORDS'][$key]);
+ unset($this->language_data['CASE_SENSITIVE'][$key]);
+ unset($this->language_data['STYLES']['KEYWORDS'][$key]);
+ }
+
+ /**
+ * Sets the content of the header block
+ *
* @param string The content of the header block
* @since 1.0.2
- */
- function set_header_content ($content)
- {
- $this->header_content = $content;
- }
-
- /**
- * Sets the content of the footer block
- *
+ */
+ function set_header_content($content) {
+ $this->header_content = $content;
+ }
+
+ /**
+ * Sets the content of the footer block
+ *
* @param string The content of the footer block
* @since 1.0.2
- */
- function set_footer_content ($content)
- {
- $this->footer_content = $content;
- }
-
- /**
- * Sets the style for the header content
- *
+ */
+ function set_footer_content($content) {
+ $this->footer_content = $content;
+ }
+
+ /**
+ * Sets the style for the header content
+ *
* @param string The style for the header content
* @since 1.0.2
- */
- function set_header_content_style ($style)
- {
- $this->header_content_style = $style;
- }
-
- /**
- * Sets the style for the footer content
- *
+ */
+ function set_header_content_style($style) {
+ $this->header_content_style = $style;
+ }
+
+ /**
+ * Sets the style for the footer content
+ *
* @param string The style for the footer content
* @since 1.0.2
- */
- function set_footer_content_style ($style)
- {
- $this->footer_content_style = $style;
- }
-
- /**
- * Sets the base URL to be used for keywords
- *
+ */
+ function set_footer_content_style($style) {
+ $this->footer_content_style = $style;
+ }
+
+ /**
+ * Sets the base URL to be used for keywords
+ *
* @param int The key of the keyword group to set the URL for
* @param string The URL to set for the group. If {FNAME} is in
* the url somewhere, it is replaced by the keyword
* that the URL is being made for
* @since 1.0.2
- */
- function set_url_for_keyword_group ($group, $url)
- {
- $this->language_data['URLS'][$group] = $url;
- }
-
- /**
- * Sets styles for links in code
- *
+ */
+ function set_url_for_keyword_group($group, $url) {
+ $this->language_data['URLS'][$group] = $url;
+ }
+
+ /**
+ * Sets styles for links in code
+ *
* @param int A constant that specifies what state the style is being
* set for - e.g. :hover or :visited
* @param string The styles to use for that state
* @since 1.0.2
- */
- function set_link_styles ($type, $styles)
- {
- $this->link_styles[$type] = $styles;
- }
+ */
+ function set_link_styles($type, $styles) {
+ $this->link_styles[$type] = $styles;
+ }
- /**
+ /**
* Sets the target for links in code
- *
+ *
* @param string The target for links in the code, e.g. _blank
* @since 1.0.3
*/
- function set_link_target ( $target )
- {
- if (!$target) {
- $this->link_target = '';
- } else {
- $this->link_target = ' target="' . $target . '" ';
- }
- }
-
- /**
- * Sets styles for important parts of the code
- *
+ function set_link_target($target) {
+ if (!$target) {
+ $this->link_target = '';
+ }
+ else {
+ $this->link_target = ' target="' . $target . '" ';
+ }
+ }
+
+ /**
+ * Sets styles for important parts of the code
+ *
* @param string The styles to use on important parts of the code
* @since 1.0.2
- */
- function set_important_styles ($styles)
- {
- $this->important_styles = $styles;
- }
-
- /**
- * Sets whether context-important blocks are highlighted
- *
+ */
+ function set_important_styles($styles) {
+ $this->important_styles = $styles;
+ }
+
+ /**
+ * Sets whether context-important blocks are highlighted
+ *
* @todo REMOVE THIS SHIZ FROM GESHI!
* @deprecated
- */
- function enable_important_blocks ( $flag )
- {
- $this->enable_important_blocks = ( $flag ) ? true : false;
- }
-
- /**
- * Whether CSS IDs should be added to each line
- *
+ */
+ function enable_important_blocks($flag) {
+ $this->enable_important_blocks = ( $flag ) ? true : false;
+ }
+
+ /**
+ * Whether CSS IDs should be added to each line
+ *
* @param boolean If true, IDs will be added to each line.
* @since 1.0.2
- */
- function enable_ids ($flag = true)
- {
- $this->add_ids = ($flag) ? true : false;
- }
-
- /**
- * Specifies which lines to highlight extra
- *
+ */
+ function enable_ids($flag = true) {
+ $this->add_ids = ($flag) ? true : false;
+ }
+
+ /**
+ * Specifies which lines to highlight extra
+ *
* @param mixed An array of line numbers to highlight, or just a line
* number on its own.
* @since 1.0.2
* @todo Some data replication here that could be cut down on
- */
- function highlight_lines_extra ($lines)
- {
- if (is_array($lines)) {
- foreach ($lines as $line) {
- $this->highlight_extra_lines[intval($line)] = intval($line);
- }
- } else {
- $this->highlight_extra_lines[intval($lines)] = intval($lines);
- }
- }
-
- /**
- * Sets the style for extra-highlighted lines
- *
+ */
+ function highlight_lines_extra($lines) {
+ if (is_array($lines)) {
+ foreach ($lines as $line) {
+ $this->highlight_extra_lines[intval($line)] = intval($line);
+ }
+ }
+ else {
+ $this->highlight_extra_lines[intval($lines)] = intval($lines);
+ }
+ }
+
+ /**
+ * Sets the style for extra-highlighted lines
+ *
* @param string The style for extra-highlighted lines
* @since 1.0.2
- */
- function set_highlight_lines_extra_style ($styles)
- {
- $this->highlight_extra_lines_style = $styles;
- }
-
- /**
- * Sets what number line numbers should start at. Should
- * be a positive integer, and will be converted to one.
- *
+ */
+ function set_highlight_lines_extra_style($styles) {
+ $this->highlight_extra_lines_style = $styles;
+ }
+
+ /**
+ * Sets what number line numbers should start at. Should
+ * be a positive integer, and will be converted to one.
+ *
* <b>Warning:</b> Using this method will add the "start"
* attribute to the &lt;ol&gt; that is used for line numbering.
* This is <b>not</b> valid XHTML strict, so if that's what you
@@ -1366,469 +1322,510 @@ class GeSHi
* support for the CSS method of doing this in 1.1 and Opera
* has support for the CSS method, but (of course) IE doesn't
* so it's not worth doing it the CSS way yet.
- *
+ *
* @param int The number to start line numbers at
* @since 1.0.2
- */
- function start_line_numbers_at ($number)
- {
- $this->line_numbers_start = abs(intval($number));
- }
-
- /**
- * Sets the encoding used for htmlspecialchars(), for international
- * support.
- *
+ */
+ function start_line_numbers_at($number) {
+ $this->line_numbers_start = abs(intval($number));
+ }
+
+ /**
+ * Sets the encoding used for htmlspecialchars(), for international
+ * support.
+ *
+ * NOTE: This is not needed for now because htmlspecialchars() is not
+ * being used (it has a security hole in PHP4 that has not been patched).
+ * Maybe in a future version it may make a return for speed reasons, but
+ * I doubt it.
+ *
* @param string The encoding to use for the source
* @since 1.0.3
- */
- function set_encoding ($encoding)
- {
+ */
+ function set_encoding($encoding) {
if ($encoding) {
- $this->encoding = $encoding;
+ $this->encoding = $encoding;
}
- }
+ }
+
+ /**
+ * Turns linking of keywords on or off.
+ *
+ * @param boolean If true, links will be added to keywords
+ */
+ function enable_keyword_links($enable = true) {
+ $this->keyword_links = ($enable) ? true : false;
+ }
- /**
- * Returns the code in $this->source, highlighted and surrounded by the
- * nessecary HTML.
- *
+ /**
+ * Returns the code in $this->source, highlighted and surrounded by the
+ * nessecary HTML.
+ *
* This should only be called ONCE, cos it's SLOW! If you want to highlight
* the same source multiple times, you're better off doing a whole lot of
* str_replaces to replace the &lt;span&gt;s
- *
+ *
* @since 1.0.0
- */
- function parse_code ()
- {
- // Start the timer
- $start_time = microtime();
-
- // Firstly, if there is an error, we won't highlight
- if ($this->error) {
- $result = @htmlspecialchars($this->source, ENT_COMPAT, $this->encoding);
- // Timing is irrelevant
- $this->set_time($start_time, $start_time);
- return $this->finalise($result);
- }
-
- // Replace all newlines to a common form.
- $code = str_replace("\r\n", "\n", $this->source);
- $code = str_replace("\r", "\n", $code);
+ */
+ function parse_code () {
+ // Start the timer
+ $start_time = microtime();
+
+ // Firstly, if there is an error, we won't highlight
+ if ($this->error) {
+ $result = GeSHi::hsc($this->source);
+ // Timing is irrelevant
+ $this->set_time($start_time, $start_time);
+ return $this->finalise($result);
+ }
+
+ // Replace all newlines to a common form.
+ $code = str_replace("\r\n", "\n", $this->source);
+ $code = str_replace("\r", "\n", $code);
// Add spaces for regular expression matching and line numbers
$code = "\n" . $code . "\n";
- // Initialise various stuff
- $length = strlen($code);
- $STRING_OPEN = '';
- $CLOSE_STRING = false;
- $ESCAPE_CHAR_OPEN = false;
- $COMMENT_MATCHED = false;
- // Turn highlighting on if strict mode doesn't apply to this language
- $HIGHLIGHTING_ON = ( !$this->strict_mode ) ? true : '';
- // Whether to highlight inside a block of code
- $HIGHLIGHT_INSIDE_STRICT = false;
- $HARDQUOTE_OPEN = false;
- $stuff_to_parse = '';
- $result = '';
-
- // "Important" selections are handled like multiline comments
+ // Initialise various stuff
+ $length = strlen($code);
+ $STRING_OPEN = '';
+ $CLOSE_STRING = false;
+ $ESCAPE_CHAR_OPEN = false;
+ $COMMENT_MATCHED = false;
+ // Turn highlighting on if strict mode doesn't apply to this language
+ $HIGHLIGHTING_ON = ( !$this->strict_mode ) ? true : '';
+ // Whether to highlight inside a block of code
+ $HIGHLIGHT_INSIDE_STRICT = false;
+ $HARDQUOTE_OPEN = false;
+ $stuff_to_parse = '';
+ $result = '';
+
+ // "Important" selections are handled like multiline comments
// @todo GET RID OF THIS SHIZ
- if ($this->enable_important_blocks) {
- $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT;
- }
-
- if ($this->strict_mode) {
- // Break the source into bits. Each bit will be a portion of the code
- // within script delimiters - for example, HTML between < and >
- $parts = array(0 => array(0 => ''));
- $k = 0;
- for ($i = 0; $i < $length; $i++) {
- $char = substr($code, $i, 1);
- if (!$HIGHLIGHTING_ON) {
- foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
- foreach ($delimiters as $open => $close) {
- // Get the next little bit for this opening string
- $check = substr($code, $i, strlen($open));
- // If it matches...
- if ($check == $open) {
- // We start a new block with the highlightable
- // code in it
- $HIGHLIGHTING_ON = $open;
- $i += strlen($open) - 1;
- $char = $open;
- $parts[++$k][0] = $char;
-
- // No point going around again...
- break(2);
- }
- }
- }
- } else {
- foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
- foreach ($delimiters as $open => $close) {
- if ($open == $HIGHLIGHTING_ON) {
- // Found the closing tag
- break(2);
- }
- }
- }
- // We check code from our current position BACKWARDS. This is so
- // the ending string for highlighting can be included in the block
- $check = substr($code, $i - strlen($close) + 1, strlen($close));
- if ($check == $close) {
- $HIGHLIGHTING_ON = '';
- // Add the string to the rest of the string for this part
- $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
- $parts[++$k][0] = '';
- $char = '';
- }
- }
- $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
- }
- $HIGHLIGHTING_ON = '';
- } else {
- // Not strict mode - simply dump the source into
- // the array at index 1 (the first highlightable block)
- $parts = array(
- 1 => array(
- 0 => '',
- 1 => $code
- )
- );
- }
-
- // Now we go through each part. We know that even-indexed parts are
- // code that shouldn't be highlighted, and odd-indexed parts should
- // be highlighted
- foreach ($parts as $key => $data) {
- $part = $data[1];
- // If this block should be highlighted...
- if ($key % 2) {
- if ($this->strict_mode) {
- // Find the class key for this block of code
- foreach ($this->language_data['SCRIPT_DELIMITERS'] as $script_key => $script_data) {
- foreach ($script_data as $open => $close) {
- if ($data[0] == $open) {
- break(2);
- }
- }
- }
-
- if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
+ if ($this->enable_important_blocks) {
+ $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT;
+ }
+
+ if ($this->strict_mode) {
+ // Break the source into bits. Each bit will be a portion of the code
+ // within script delimiters - for example, HTML between < and >
+ $parts = array(0 => array(0 => ''));
+ $k = 0;
+ for ($i = 0; $i < $length; $i++) {
+ $char = substr($code, $i, 1);
+ if (!$HIGHLIGHTING_ON) {
+ foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
+ foreach ($delimiters as $open => $close) {
+ // Get the next little bit for this opening string
+ $check = substr($code, $i, strlen($open));
+ // If it matches...
+ if ($check == $open) {
+ // We start a new block with the highlightable
+ // code in it
+ $HIGHLIGHTING_ON = $open;
+ $i += strlen($open) - 1;
+ $char = $open;
+ $parts[++$k][0] = $char;
+
+ // No point going around again...
+ break(2);
+ }
+ }
+ }
+ }
+ else {
+ foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
+ foreach ($delimiters as $open => $close) {
+ if ($open == $HIGHLIGHTING_ON) {
+ // Found the closing tag
+ break(2);
+ }
+ }
+ }
+ // We check code from our current position BACKWARDS. This is so
+ // the ending string for highlighting can be included in the block
+ $check = substr($code, $i - strlen($close) + 1, strlen($close));
+ if ($check == $close) {
+ $HIGHLIGHTING_ON = '';
+ // Add the string to the rest of the string for this part
+ $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
+ $parts[++$k][0] = '';
+ $char = '';
+ }
+ }
+ $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
+ }
+ $HIGHLIGHTING_ON = '';
+ }
+ else {
+ // Not strict mode - simply dump the source into
+ // the array at index 1 (the first highlightable block)
+ $parts = array(
+ 1 => array(
+ 0 => '',
+ 1 => $code
+ )
+ );
+ }
+
+ // Now we go through each part. We know that even-indexed parts are
+ // code that shouldn't be highlighted, and odd-indexed parts should
+ // be highlighted
+ foreach ($parts as $key => $data) {
+ $part = $data[1];
+ // If this block should be highlighted...
+ if ($key % 2) {
+ if ($this->strict_mode) {
+ // Find the class key for this block of code
+ foreach ($this->language_data['SCRIPT_DELIMITERS'] as $script_key => $script_data) {
+ foreach ($script_data as $open => $close) {
+ if ($data[0] == $open) {
+ break(2);
+ }
+ }
+ }
+
+ if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
$this->lexic_permissions['SCRIPT']) {
- // Add a span element around the source to
- // highlight the overall source block
- if (!$this->use_classes &&
+ // Add a span element around the source to
+ // highlight the overall source block
+ if (!$this->use_classes &&
$this->language_data['STYLES']['SCRIPT'][$script_key] != '') {
- $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
- } else {
- $attributes = ' class="sc' . $script_key . '"';
- }
- $result .= "<span$attributes>";
- }
- }
-
- if (!$this->strict_mode || $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]) {
- // Now, highlight the code in this block. This code
- // is really the engine of GeSHi (along with the method
- // parse_non_string_part).
- $length = strlen($part);
- for ($i = 0; $i < $length; $i++) {
- // Get the next char
- $char = substr($part, $i, 1);
- $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
- // Is this char the newline and line numbers being used?
- if (($this->line_numbers != GESHI_NO_LINE_NUMBERS
+ $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
+ }
+ else {
+ $attributes = ' class="sc' . $script_key . '"';
+ }
+ $result .= "<span$attributes>";
+ }
+ }
+
+ if (!$this->strict_mode || $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]) {
+ // Now, highlight the code in this block. This code
+ // is really the engine of GeSHi (along with the method
+ // parse_non_string_part).
+ $length = strlen($part);
+ for ($i = 0; $i < $length; $i++) {
+ // Get the next char
+ $char = substr($part, $i, 1);
+ $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
+ // Is this char the newline and line numbers being used?
+ if (($this->line_numbers != GESHI_NO_LINE_NUMBERS
|| count($this->highlight_extra_lines) > 0)
&& $char == "\n") {
- // If so, is there a string open? If there is, we should end it before
- // the newline and begin it again (so when <li>s are put in the source
- // remains XHTML compliant)
- // note to self: This opens up possibility of config files specifying
- // that languages can/cannot have multiline strings???
- if ($STRING_OPEN) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
- } else {
- $attributes = ' class="st0"';
- }
- $char = '</span>' . $char . "<span$attributes>";
- }
- } elseif ($char == $STRING_OPEN) {
+ // If so, is there a string open? If there is, we should end it before
+ // the newline and begin it again (so when <li>s are put in the source
+ // remains XHTML compliant)
+ // note to self: This opens up possibility of config files specifying
+ // that languages can/cannot have multiline strings???
+ if ($STRING_OPEN) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+ }
+ else {
+ $attributes = ' class="st0"';
+ }
+ $char = '</span>' . $char . "<span$attributes>";
+ }
+ }
+ else if ($char == $STRING_OPEN) {
// A match of a string delimiter
- if (($this->lexic_permissions['ESCAPE_CHAR'] && $ESCAPE_CHAR_OPEN) ||
+ if (($this->lexic_permissions['ESCAPE_CHAR'] && $ESCAPE_CHAR_OPEN) ||
($this->lexic_permissions['STRINGS'] && !$ESCAPE_CHAR_OPEN)) {
- $char = htmlspecialchars($char, ENT_COMPAT, $this->encoding) . '</span>';
- }
- $escape_me = false;
- if ($HARDQUOTE_OPEN)
- {
- if ($ESCAPE_CHAR_OPEN)
- $escape_me = true;
- else {
- foreach ($this->language_data['HARDESCAPE'] as $hardesc)
- if (substr($part, $i, strlen($hardesc)) == $hardesc)
- {
- $escape_me = true;
- break;
- }
- }
- }
- if (!$ESCAPE_CHAR_OPEN) {
- $STRING_OPEN = '';
- $CLOSE_STRING = true;
- }
- if (!$escape_me) {
- $HARDQUOTE_OPEN = false;
- }
- $ESCAPE_CHAR_OPEN = false;
- } elseif (in_array($char, $this->language_data['QUOTEMARKS']) &&
+ $char = GeSHi::hsc($char) . '</span>';
+ }
+ $escape_me = false;
+ if ($HARDQUOTE_OPEN) {
+ if ($ESCAPE_CHAR_OPEN) {
+ $escape_me = true;
+ }
+ else {
+ foreach ($this->language_data['HARDESCAPE'] as $hardesc) {
+ if (substr($part, $i, strlen($hardesc)) == $hardesc) {
+ $escape_me = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!$ESCAPE_CHAR_OPEN) {
+ $STRING_OPEN = '';
+ $CLOSE_STRING = true;
+ }
+ if (!$escape_me) {
+ $HARDQUOTE_OPEN = false;
+ }
+ $ESCAPE_CHAR_OPEN = false;
+ }
+ else if (in_array($char, $this->language_data['QUOTEMARKS']) &&
($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']) {
// The start of a new string
- $STRING_OPEN = $char;
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
- } else {
- $attributes = ' class="st0"';
- }
- $char = "<span$attributes>" . htmlspecialchars($char, ENT_COMPAT, $this->encoding);
-
- $result .= $this->parse_non_string_part( $stuff_to_parse );
- $stuff_to_parse = '';
- } elseif (
- $hq &&
- substr($part, $i, strlen($hq)) == $hq &&
- ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']
- )
- {
- // The start of a hard quoted string
- $STRING_OPEN = $this->language_data['HARDQUOTE'][1];
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
- } else {
- $attributes = ' class="st0"';
- }
- $char = "<span$attributes>" . $hq;
- $i += strlen($hq) - 1;
- $HARDQUOTE_OPEN = true;
- $result .= $this->parse_non_string_part( $stuff_to_parse );
- $stuff_to_parse = '';
- } elseif ($char == $this->language_data['ESCAPE_CHAR'] && $STRING_OPEN != '')
- {
+ $STRING_OPEN = $char;
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+ }
+ else {
+ $attributes = ' class="st0"';
+ }
+ $char = "<span$attributes>" . GeSHi::hsc($char);
+
+ $result .= $this->parse_non_string_part( $stuff_to_parse );
+ $stuff_to_parse = '';
+ }
+ else if ($hq && substr($part, $i, strlen($hq)) == $hq &&
+ ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']) {
+ // The start of a hard quoted string
+ $STRING_OPEN = $this->language_data['HARDQUOTE'][1];
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+ }
+ else {
+ $attributes = ' class="st0"';
+ }
+ $char = "<span$attributes>" . $hq;
+ $i += strlen($hq) - 1;
+ $HARDQUOTE_OPEN = true;
+ $result .= $this->parse_non_string_part($stuff_to_parse);
+ $stuff_to_parse = '';
+ }
+ else if ($char == $this->language_data['ESCAPE_CHAR'] && $STRING_OPEN != '') {
// An escape character
- if (!$ESCAPE_CHAR_OPEN) {
- $ESCAPE_CHAR_OPEN = !$HARDQUOTE_OPEN; // true unless $HARDQUOTE_OPEN
- if ($HARDQUOTE_OPEN)
- foreach ($this->language_data['HARDESCAPE'] as $hard)
- {
- if (substr($part, $i, strlen($hard)) == $hard)
- {
- $ESCAPE_CHAR_OPEN = true;
- break;
- }
- }
- if ($ESCAPE_CHAR_OPEN && $this->lexic_permissions['ESCAPE_CHAR']) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
- } else {
- $attributes = ' class="es0"';
- }
- $char = "<span$attributes>" . $char;
+ if (!$ESCAPE_CHAR_OPEN) {
+ $ESCAPE_CHAR_OPEN = !$HARDQUOTE_OPEN; // true unless $HARDQUOTE_OPEN
+ if ($HARDQUOTE_OPEN) {
+ foreach ($this->language_data['HARDESCAPE'] as $hard) {
+ if (substr($part, $i, strlen($hard)) == $hard) {
+ $ESCAPE_CHAR_OPEN = true;
+ break;
+ }
+ }
+ }
+ if ($ESCAPE_CHAR_OPEN && $this->lexic_permissions['ESCAPE_CHAR']) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
+ }
+ else {
+ $attributes = ' class="es0"';
+ }
+ $char = "<span$attributes>" . $char;
if (substr($code, $i + 1, 1) == "\n") {
// escaping a newline, what's the point in putting the span around
// the newline? It only causes hassles when inserting line numbers
$char .= '</span>';
$ESCAPE_CHAR_OPEN = false;
}
- }
- } else {
- $ESCAPE_CHAR_OPEN = false;
- if ($this->lexic_permissions['ESCAPE_CHAR']) {
- $char .= '</span>';
- }
- }
- } elseif ($ESCAPE_CHAR_OPEN) {
- if ($this->lexic_permissions['ESCAPE_CHAR']) {
- $char .= '</span>';
- }
- $ESCAPE_CHAR_OPEN = false;
- $test_str = $char;
- } elseif ($STRING_OPEN == '') {
- // Is this a multiline comment?
- foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
- $com_len = strlen($open);
- $test_str = substr( $part, $i, $com_len );
- $test_str_match = $test_str;
- if ($open == $test_str) {
- $COMMENT_MATCHED = true;
+ }
+ }
+ else {
+ $ESCAPE_CHAR_OPEN = false;
+ if ($this->lexic_permissions['ESCAPE_CHAR']) {
+ $char .= '</span>';
+ }
+ }
+ }
+ else if ($ESCAPE_CHAR_OPEN) {
+ if ($this->lexic_permissions['ESCAPE_CHAR']) {
+ $char .= '</span>';
+ }
+ $ESCAPE_CHAR_OPEN = false;
+ $test_str = $char;
+ }
+ else if ($STRING_OPEN == '') {
+ // Is this a multiline comment?
+ foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
+ $com_len = strlen($open);
+ $test_str = substr( $part, $i, $com_len );
+ $test_str_match = $test_str;
+ if ($open == $test_str) {
+ $COMMENT_MATCHED = true;
//@todo If remove important do remove here
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
+ if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
$test_str == GESHI_START_IMPORTANT) {
- if ($test_str != GESHI_START_IMPORTANT) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
- } else {
- $attributes = ' class="coMULTI"';
- }
- $test_str = "<span$attributes>" . @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding);
- } else {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->important_styles . '"';
- } else {
- $attributes = ' class="imp"';
- }
- // We don't include the start of the comment if it's an
- // "important" part
- $test_str = "<span$attributes>";
- }
- } else {
- $test_str = @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding);
- }
-
- $close_pos = strpos( $part, $close, $i + strlen($close) );
-
- if ($close_pos === false) {
- $close_pos = strlen($part);
- }
-
- // Short-cut through all the multiline code
- $rest_of_comment = @htmlspecialchars(substr($part, $i + $com_len, $close_pos - $i), ENT_COMPAT, $this->encoding);
- if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
+ if ($test_str != GESHI_START_IMPORTANT) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
+ }
+ else {
+ $attributes = ' class="coMULTI"';
+ }
+ $test_str = "<span$attributes>" . GeSHi::hsc($test_str);
+ }
+ else {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->important_styles . '"';
+ }
+ else {
+ $attributes = ' class="imp"';
+ }
+ // We don't include the start of the comment if it's an
+ // "important" part
+ $test_str = "<span$attributes>";
+ }
+ }
+ else {
+ $test_str = GeSHi::hsc($test_str);
+ }
+
+ $close_pos = strpos( $part, $close, $i + strlen($close) );
+
+ $oops = false;
+ if ($close_pos === false) {
+ $close_pos = strlen($part);
+ $oops = true;
+ }
+ else {
+ $close_pos -= ($com_len - strlen($close));
+ }
+
+ // Short-cut through all the multiline code
+ $rest_of_comment = GeSHi::hsc(substr($part, $i + $com_len, $close_pos - $i));
+ if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
$test_str_match == GESHI_START_IMPORTANT) &&
($this->line_numbers != GESHI_NO_LINE_NUMBERS ||
count($this->highlight_extra_lines) > 0)) {
- // strreplace to put close span and open span around multiline newlines
- $test_str .= str_replace("\n", "</span>\n<span$attributes>", $rest_of_comment);
- } else {
- $test_str .= $rest_of_comment;
- }
+ // strreplace to put close span and open span around multiline newlines
+ $test_str .= str_replace("\n", "</span>\n<span$attributes>", $rest_of_comment);
+ }
+ else {
+ $test_str .= $rest_of_comment;
+ }
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
+ if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
$test_str_match == GESHI_START_IMPORTANT) {
- $test_str .= '</span>';
- }
- $i = $close_pos + $com_len - 1;
- // parse the rest
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- break;
- }
- }
- // If we haven't matched a multiline comment, try single-line comments
- if (!$COMMENT_MATCHED) {
- foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
- $com_len = strlen($comment_mark);
- $test_str = substr($part, $i, $com_len);
- if ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS]) {
- $match = ($comment_mark == $test_str);
- } else {
- $match = (strtolower($comment_mark) == strtolower($test_str));
- }
- if ($match) {
- $COMMENT_MATCHED = true;
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
- } else {
- $attributes = ' class="co' . $comment_key . '"';
- }
- $test_str = "<span$attributes>" . @htmlspecialchars($this->change_case($test_str), ENT_COMPAT, $this->encoding);
- } else {
- $test_str = @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding);
- }
- $close_pos = strpos($part, "\n", $i);
+ $test_str .= '</span>';
+ if ($oops) {
+ $test_str .= "\n";
+ }
+ }
+ $i = $close_pos + $com_len - 1;
+ // parse the rest
+ $result .= $this->parse_non_string_part($stuff_to_parse);
+ $stuff_to_parse = '';
+ break;
+ }
+ }
+ // If we haven't matched a multiline comment, try single-line comments
+ if (!$COMMENT_MATCHED) {
+ foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
+ $com_len = strlen($comment_mark);
+ $test_str = substr($part, $i, $com_len);
+ if ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS]) {
+ $match = ($comment_mark == $test_str);
+ }
+ else {
+ $match = (strtolower($comment_mark) == strtolower($test_str));
+ }
+ if ($match) {
+ $COMMENT_MATCHED = true;
+ if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
+ }
+ else {
+ $attributes = ' class="co' . $comment_key . '"';
+ }
+ $test_str = "<span$attributes>" . GeSHi::hsc($this->change_case($test_str));
+ }
+ else {
+ $test_str = GeSHi::hsc($test_str);
+ }
+ $close_pos = strpos($part, "\n", $i);
$oops = false;
- if ($close_pos === false) {
- $close_pos = strlen($part);
+ if ($close_pos === false) {
+ $close_pos = strlen($part);
$oops = true;
- }
- $test_str .= @htmlspecialchars(substr($part, $i + $com_len, $close_pos - $i - $com_len), ENT_COMPAT, $this->encoding);
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
- $test_str .= "</span>";
- }
+ }
+ $test_str .= GeSHi::hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len));
+ if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
+ $test_str .= "</span>";
+ }
// Take into account that the comment might be the last in the source
- if (!$oops) {
- $test_str .= "\n";
+ if (!$oops) {
+ $test_str .= "\n";
}
- $i = $close_pos;
- // parse the rest
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- break;
- }
- }
- }
- } elseif ($STRING_OPEN != '') {
+ $i = $close_pos;
+ // parse the rest
+ $result .= $this->parse_non_string_part($stuff_to_parse);
+ $stuff_to_parse = '';
+ break;
+ }
+ }
+ }
+ }
+ else if ($STRING_OPEN != '') {
// Otherwise, convert it to HTML form
- if (strtolower($this->encoding) == 'utf-8') {
- //only escape <128 (we don't want to break multibyte chars)
- if (ord($char) < 128) {
- $char = @htmlspecialchars($char, ENT_COMPAT, $this->encoding);
- }
- } else {
- //encode everthing
- $char = @htmlspecialchars($char, ENT_COMPAT, $this->encoding);
- }
- }
- // Where are we adding this char?
- if (!$COMMENT_MATCHED) {
- if (($STRING_OPEN == '') && !$CLOSE_STRING) {
- $stuff_to_parse .= $char;
- } else {
- $result .= $char;
- $CLOSE_STRING = false;
- }
- } else {
- $result .= $test_str;
- $COMMENT_MATCHED = false;
- }
- }
- // Parse the last bit
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- } else {
- $result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
- }
- // Close the <span> that surrounds the block
- if ($this->strict_mode && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
+ if (strtolower($this->encoding) == 'utf-8') {
+ //only escape <128 (we don't want to break multibyte chars)
+ if (ord($char) < 128) {
+ $char = GeSHi::hsc($char);
+ }
+ }
+ else {
+ //encode everthing
+ $char = GeSHi::hsc($char);
+ }
+ }
+ // Where are we adding this char?
+ if (!$COMMENT_MATCHED) {
+ if (($STRING_OPEN == '') && !$CLOSE_STRING) {
+ $stuff_to_parse .= $char;
+ }
+ else {
+ $result .= $char;
+ $CLOSE_STRING = false;
+ }
+ }
+ else {
+ $result .= $test_str;
+ $COMMENT_MATCHED = false;
+ }
+ }
+ // Parse the last bit
+ $result .= $this->parse_non_string_part($stuff_to_parse);
+ $stuff_to_parse = '';
+ }
+ else {
+ $result .= GeSHi::hsc($part);
+ }
+ // Close the <span> that surrounds the block
+ if ($this->strict_mode && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
$this->lexic_permissions['SCRIPT']) {
- $result .= '</span>';
- }
- } else {
+ $result .= '</span>';
+ }
+ }
+ else {
// Else not a block to highlight
- $result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding);
- }
- }
+ $result .= GeSHi::hsc($part);
+ }
+ }
- // Parse the last stuff (redundant?)
- $result .= $this->parse_non_string_part($stuff_to_parse);
+ // Parse the last stuff (redundant?)
+ $result .= $this->parse_non_string_part($stuff_to_parse);
- // Lop off the very first and last spaces
- $result = substr($result, 1, -1);
+ // Lop off the very first and last spaces
+ $result = substr($result, 1, -1);
- // Are we still in a string?
- if ($STRING_OPEN) {
- $result .= '</span>';
- }
+ // Are we still in a string?
+ if ($STRING_OPEN) {
+ $result .= '</span>';
+ }
- // We're finished: stop timing
- $this->set_time($start_time, microtime());
+ // We're finished: stop timing
+ $this->set_time($start_time, microtime());
- return $this->finalise($result);
- }
+ return $this->finalise($result);
+ }
- /**
- * Swaps out spaces and tabs for HTML indentation. Not needed if
- * the code is in a pre block...
- *
+ /**
+ * Swaps out spaces and tabs for HTML indentation. Not needed if
+ * the code is in a pre block...
+ *
* @param string The source to indent
* @return string The source with HTML indenting applied
* @since 1.0.0
* @access private
- */
- function indent ($result)
- {
+ */
+ function indent($result) {
/// Replace tabs with the correct number of spaces
if (false !== strpos($result, "\t")) {
$lines = explode("\n", $result);
@@ -1837,7 +1834,7 @@ class GeSHi
$lines[$key] = $line;
continue;
}
-
+
$pos = 0;
$tab_width = $this->tab_width;
$length = strlen($line);
@@ -1857,18 +1854,22 @@ class GeSHi
$IN_TAG = false;
$result_line .= '>';
++$pos;
- } elseif (!$IN_TAG && '<' == $char) {
+ }
+ else if (!$IN_TAG && '<' == $char) {
$IN_TAG = true;
$result_line .= '<';
++$pos;
- } elseif (!$IN_TAG && '&' == $char) { $substr = substr($line, $i + 3, 4);
+ }
+ else if (!$IN_TAG && '&' == $char) {
+ $substr = substr($line, $i + 3, 4);
//$substr_5 = substr($line, 5, 1);
$posi = strpos($substr, ';');
if (false !== $posi) {
$pos += $posi + 3;
}
$result_line .= '&';
- } elseif (!$IN_TAG && "\t" == $char) {
+ }
+ else if (!$IN_TAG && "\t" == $char) {
$str = '';
// OPTIMISE - move $strs out. Make an array:
// $tabs = array(
@@ -1879,19 +1880,18 @@ class GeSHi
$strs = array(0 => '&nbsp;', 1 => ' ');
for ($k = 0; $k < ($tab_width - (($i - $pos) % $tab_width)); $k++) $str .= $strs[$k % 2];
$result_line .= $str;
- //$pos--;
$pos++;
- //$pos -= $tab_width-1;
if (false === strpos($line, "\t", $i + 1)) {
- //$lines[$key] = $result_line;
$result_line .= substr($line, $i + 1);
break;
}
- } elseif ( $IN_TAG ) {
+ }
+ else if ($IN_TAG) {
++$pos;
$result_line .= $char;
- } else {
+ }
+ else {
$result_line .= $char;
//++$pos;
}
@@ -1900,38 +1900,38 @@ class GeSHi
}
$result = implode("\n", $lines);
}
- // Other whitespace
- $result = str_replace(' ', '&nbsp; ', $result);
- $result = str_replace(' ', ' &nbsp;', $result);
- $result = str_replace("\n ", "\n&nbsp;", $result);
-
- if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) {
- $result = nl2br($result);
- }
- return $result;
- }
-
- /**
- * Changes the case of a keyword for those languages where a change is asked for
- *
+ // Other whitespace
+ $result = str_replace(' ', '&nbsp; ', $result);
+ $result = str_replace(' ', ' &nbsp;', $result);
+ $result = str_replace("\n ", "\n&nbsp;", $result);
+
+ if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) {
+ $result = nl2br($result);
+ }
+ return $result;
+ }
+
+ /**
+ * Changes the case of a keyword for those languages where a change is asked for
+ *
* @param string The keyword to change the case of
* @return string The keyword with its case changed
* @since 1.0.0
* @access private
- */
- function change_case ($instr)
- {
- if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_UPPER) {
- return strtoupper($instr);
- } elseif ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_LOWER) {
- return strtolower($instr);
- }
- return $instr;
- }
-
- /**
- * Adds a url to a keyword where needed.
- *
+ */
+ function change_case($instr) {
+ if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_UPPER) {
+ return strtoupper($instr);
+ }
+ else if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_LOWER) {
+ return strtolower($instr);
+ }
+ return $instr;
+ }
+
+ /**
+ * Adds a url to a keyword where needed.
+ *
* @param string The keyword to add the URL HTML to
* @param int What group the keyword is from
* @param boolean Whether to get the HTML for the start or end
@@ -1939,18 +1939,22 @@ class GeSHi
* @since 1.0.2
* @access private
* @todo Get rid of ender
- */
- function add_url_to_keyword ($keyword, $group, $start_or_end)
- {
+ */
+ function add_url_to_keyword($keyword, $group, $start_or_end) {
+ if (!$this->keyword_links) {
+ // Keyword links have been disabled
+ return;
+ }
+
if (isset($this->language_data['URLS'][$group]) &&
$this->language_data['URLS'][$group] != '' &&
substr($keyword, 0, 5) != '&lt;/') {
- // There is a base group for this keyword
- if ($start_or_end == 'BEGIN') {
- // HTML workaround... not good form (tm) but should work for 1.0.X
- if ($keyword != '') {
+ // There is a base group for this keyword
+ if ($start_or_end == 'BEGIN') {
+ // HTML workaround... not good form (tm) but should work for 1.0.X
+ if ($keyword != '') {
// Old system: strtolower
- //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
+ //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
// New system: get keyword from language file to get correct case
foreach ($this->language_data['KEYWORDS'][$group] as $word) {
if (strtolower($word) == strtolower($keyword)) {
@@ -1960,271 +1964,274 @@ class GeSHi
$word = ( substr($word, 0, 4) == '&lt;' ) ? substr($word, 4) : $word;
$word = ( substr($word, -4) == '&gt;' ) ? substr($word, 0, strlen($word) - 4) : $word;
if (!$word) return '';
-
- return '<|UR1|"' .
+
+ return '<|UR1|"' .
str_replace(
array('{FNAME}', '.'),
- array(@htmlspecialchars($word, ENT_COMPAT, $this->encoding), '<DOT>'),
+ array(GeSHi::hsc($word), '<DOT>'),
$this->language_data['URLS'][$group]
) . '">';
- }
- return '';
+ }
+ return '';
// HTML fix. Again, dirty hackage...
- } elseif (!($this->language == 'html4strict' && '&gt;' == $keyword)) {
- return '</a>';
- }
- }
- }
-
- /**
- * Takes a string that has no strings or comments in it, and highlights
- * stuff like keywords, numbers and methods.
- *
+ }
+ else if (!($this->language == 'html4strict' && '&gt;' == $keyword)) {
+ return '</a>';
+ }
+ }
+ }
+
+ /**
+ * Takes a string that has no strings or comments in it, and highlights
+ * stuff like keywords, numbers and methods.
+ *
* @param string The string to parse for keyword, numbers etc.
* @since 1.0.0
* @access private
* @todo BUGGY! Why? Why not build string and return?
- */
- function parse_non_string_part (&$stuff_to_parse)
- {
- $stuff_to_parse = ' ' . @htmlspecialchars($stuff_to_parse, ENT_COMPAT, $this->encoding);
+ */
+ function parse_non_string_part(&$stuff_to_parse) {
+ $stuff_to_parse = ' ' . GeSHi::hsc($stuff_to_parse);
$stuff_to_parse_pregquote = preg_quote($stuff_to_parse, '/');
- $func = '$this->change_case';
- $func2 = '$this->add_url_to_keyword';
-
- //
- // Regular expressions
- //
- foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
- if ($this->lexic_permissions['REGEXPS'][$key]) {
- if (is_array($regexp)) {
- $stuff_to_parse = preg_replace(
+ $func = '$this->change_case';
+ $func2 = '$this->add_url_to_keyword';
+
+ //
+ // Regular expressions
+ //
+ foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
+ if ($this->lexic_permissions['REGEXPS'][$key]) {
+ if (is_array($regexp)) {
+ $stuff_to_parse = preg_replace(
"/" .
str_replace('/', '\/', $regexp[GESHI_SEARCH]) .
"/{$regexp[GESHI_MODIFIERS]}",
"{$regexp[GESHI_BEFORE]}<|!REG3XP$key!>{$regexp[GESHI_REPLACE]}|>{$regexp[GESHI_AFTER]}",
$stuff_to_parse
);
- } else {
- $stuff_to_parse = preg_replace( "/(" . str_replace('/', '\/', $regexp) . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
- }
- }
- }
-
- //
- // Highlight numbers. This regexp sucks... anyone with a regexp that WORKS
- // here wins a cookie if they send it to me. At the moment there's two doing
- // almost exactly the same thing, except the second one prevents a number
- // being highlighted twice (eg <span...><span...>5</span></span>)
- // Put /NUM!/ in for the styles, which gets replaced at the end.
+ }
+ else {
+ $stuff_to_parse = preg_replace( "/(" . str_replace('/', '\/', $regexp) . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
+ }
+ }
+ }
+
+ //
+ // Highlight numbers. This regexp sucks... anyone with a regexp that WORKS
+ // here wins a cookie if they send it to me. At the moment there's two doing
+ // almost exactly the same thing, except the second one prevents a number
+ // being highlighted twice (eg <span...><span...>5</span></span>)
+ // Put /NUM!/ in for the styles, which gets replaced at the end.
//
// NEW ONE: Brice Bernard
- // $stuff_to_parse = preg_replace('/([^(\\w|#|\\\|"|\')])(\\d+)/', '\\1<|/NUM!/>\\2|>', $stuff_to_parse);
- //$stuff_to_parse = preg_replace('/([-+]?\\b(?:[0-9]*\\.)?[0-9]+\\b)/', '<|/NUM!/>\\1|>', $stuff_to_parse);
- //
- if ($this->lexic_permissions['NUMBERS'] && preg_match('#[0-9]#', $stuff_to_parse )) {
- //$stuff_to_parse = preg_replace('#([^a-zA-Z0-9_\#])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse);
- //$stuff_to_parse = preg_replace('#([^a-zA-Z0-9_\#>])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse);
+ //
+ if ($this->lexic_permissions['NUMBERS'] && preg_match('#[0-9]#', $stuff_to_parse )) {
$stuff_to_parse = preg_replace('/([-+]?\\b(?:[0-9]*\\.)?[0-9]+\\b)/', '<|/NUM!/>\\1|>', $stuff_to_parse);
- }
-
- // Highlight keywords
- // if there is a couple of alpha symbols there *might* be a keyword
- if (preg_match('#[a-zA-Z]{2,}#', $stuff_to_parse)) {
- foreach ($this->language_data['KEYWORDS'] as $k => $keywordset) {
- if ($this->lexic_permissions['KEYWORDS'][$k]) {
- foreach ($keywordset as $keyword) {
- $keyword = preg_quote($keyword, '/');
- //
- // This replacement checks the word is on it's own (except if brackets etc
- // are next to it), then highlights it. We don't put the color=" for the span
- // in just yet - otherwise languages with the keywords "color" or "or" have
- // a fit.
- //
- if (false !== stristr($stuff_to_parse_pregquote, $keyword )) {
- $stuff_to_parse .= ' ';
- // Might make a more unique string for putting the number in soon
- // Basically, we don't put the styles in yet because then the styles themselves will
- // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
- $styles = "/$k/";
- if ($this->language_data['CASE_SENSITIVE'][$k]) {
- $stuff_to_parse = preg_replace(
+ }
+
+ // Highlight keywords
+ // if there is a couple of alpha symbols there *might* be a keyword
+ if (preg_match('#[a-zA-Z]{2,}#', $stuff_to_parse)) {
+ foreach ($this->language_data['KEYWORDS'] as $k => $keywordset) {
+ if ($this->lexic_permissions['KEYWORDS'][$k]) {
+ foreach ($keywordset as $keyword) {
+ $keyword = preg_quote($keyword, '/');
+ //
+ // This replacement checks the word is on it's own (except if brackets etc
+ // are next to it), then highlights it. We don't put the color=" for the span
+ // in just yet - otherwise languages with the keywords "color" or "or" have
+ // a fit.
+ //
+ if (false !== stristr($stuff_to_parse_pregquote, $keyword )) {
+ $stuff_to_parse .= ' ';
+ // Might make a more unique string for putting the number in soon
+ // Basically, we don't put the styles in yet because then the styles themselves will
+ // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
+ $styles = "/$k/";
+ if ($this->language_data['CASE_SENSITIVE'][$k]) {
+ $stuff_to_parse = preg_replace(
"/([^a-zA-Z0-9\$_\|\#;>|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/e",
"'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')",
$stuff_to_parse
);
- } else {
- // Change the case of the word.
+ }
+ else {
+ // Change the case of the word.
// hackage again... must... release... 1.2...
if ('smarty' == $this->language) { $hackage = '\/'; } else { $hackage = ''; }
- $stuff_to_parse = preg_replace(
+ $stuff_to_parse = preg_replace(
"/([^a-zA-Z0-9\$_\|\#;>$hackage|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/ie",
"'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')",
$stuff_to_parse
);
- }
- $stuff_to_parse = substr($stuff_to_parse, 0, strlen($stuff_to_parse) - 1);
- }
- }
- }
- }
- }
-
- //
- // Now that's all done, replace /[number]/ with the correct styles
- //
- foreach ($this->language_data['KEYWORDS'] as $k => $kws) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['KEYWORDS'][$k] . '"';
- } else {
- $attributes = ' class="kw' . $k . '"';
- }
- $stuff_to_parse = str_replace("/$k/", $attributes, $stuff_to_parse);
- }
-
- // Put number styles in
- if (!$this->use_classes && $this->lexic_permissions['NUMBERS']) {
- $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][0] . '"';
- } else {
- $attributes = ' class="nu0"';
- }
- $stuff_to_parse = str_replace('/NUM!/', $attributes, $stuff_to_parse);
-
- //
- // Highlight methods and fields in objects
- //
- if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) {
- foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
- if (false !== stristr($stuff_to_parse, $splitter)) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
- } else {
- $attributes = ' class="me' . $key . '"';
- }
- $stuff_to_parse = preg_replace("/(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], 1) . "[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)/", "\\1<|$attributes>\\2|>", $stuff_to_parse);
- }
- }
- }
-
- //
- // Highlight brackets. Yes, I've tried adding a semi-colon to this list.
- // You try it, and see what happens ;)
- // TODO: Fix lexic permissions not converting entities if shouldn't
- // be highlighting regardless
- //
- if ($this->lexic_permissions['BRACKETS']) {
- $code_entities_match = array('[', ']', '(', ')', '{', '}');
- if (!$this->use_classes) {
- $code_entities_replace = array(
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
- );
- } else {
- $code_entities_replace = array(
- '<| class="br0">&#91;|>',
- '<| class="br0">&#93;|>',
- '<| class="br0">&#40;|>',
- '<| class="br0">&#41;|>',
- '<| class="br0">&#123;|>',
- '<| class="br0">&#125;|>',
- );
- }
- $stuff_to_parse = str_replace( $code_entities_match, $code_entities_replace, $stuff_to_parse );
- }
-
- //
- // Add class/style for regexps
- //
- foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
- if ($this->lexic_permissions['REGEXPS'][$key]) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
- } else {
+ }
+ $stuff_to_parse = substr($stuff_to_parse, 0, strlen($stuff_to_parse) - 1);
+ }
+ }
+ }
+ }
+ }
+
+ //
+ // Now that's all done, replace /[number]/ with the correct styles
+ //
+ foreach ($this->language_data['KEYWORDS'] as $k => $kws) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['KEYWORDS'][$k] . '"';
+ }
+ else {
+ $attributes = ' class="kw' . $k . '"';
+ }
+ $stuff_to_parse = str_replace("/$k/", $attributes, $stuff_to_parse);
+ }
+
+ // Put number styles in
+ if (!$this->use_classes && $this->lexic_permissions['NUMBERS']) {
+ $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][0] . '"';
+ }
+ else {
+ $attributes = ' class="nu0"';
+ }
+ $stuff_to_parse = str_replace('/NUM!/', $attributes, $stuff_to_parse);
+
+ //
+ // Highlight methods and fields in objects
+ //
+ if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) {
+ foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
+ if (false !== stristr($stuff_to_parse, $splitter)) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
+ }
+ else {
+ $attributes = ' class="me' . $key . '"';
+ }
+ $stuff_to_parse = preg_replace("/(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], 1) . "[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)/", "\\1<|$attributes>\\2|>", $stuff_to_parse);
+ }
+ }
+ }
+
+ //
+ // Highlight brackets. Yes, I've tried adding a semi-colon to this list.
+ // You try it, and see what happens ;)
+ // TODO: Fix lexic permissions not converting entities if shouldn't
+ // be highlighting regardless
+ //
+ if ($this->lexic_permissions['BRACKETS']) {
+ $code_entities_match = array('[', ']', '(', ')', '{', '}');
+ if (!$this->use_classes) {
+ $code_entities_replace = array(
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
+ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
+ );
+ }
+ else {
+ $code_entities_replace = array(
+ '<| class="br0">&#91;|>',
+ '<| class="br0">&#93;|>',
+ '<| class="br0">&#40;|>',
+ '<| class="br0">&#41;|>',
+ '<| class="br0">&#123;|>',
+ '<| class="br0">&#125;|>',
+ );
+ }
+ $stuff_to_parse = str_replace( $code_entities_match, $code_entities_replace, $stuff_to_parse );
+ }
+
+ //
+ // Add class/style for regexps
+ //
+ foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
+ if ($this->lexic_permissions['REGEXPS'][$key]) {
+ if (!$this->use_classes) {
+ $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
+ }
+ else {
if(is_array($this->language_data['REGEXPS'][$key]) &&
array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) {
$attributes = ' class="'
. $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
- } else {
- $attributes = ' class="re' . $key . '"';
}
- }
- $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
- }
- }
-
- // Replace <DOT> with . for urls
- $stuff_to_parse = str_replace('<DOT>', '.', $stuff_to_parse);
- // Replace <|UR1| with <a href= for urls also
- if (isset($this->link_styles[GESHI_LINK])) {
- if ($this->use_classes) {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
- } else {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);
- }
- } else {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
- }
-
- //
- // NOW we add the span thingy ;)
- //
-
- $stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
- $stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
-
- return substr($stuff_to_parse, 1);
- }
-
- /**
- * Sets the time taken to parse the code
- *
+ else {
+ $attributes = ' class="re' . $key . '"';
+ }
+ }
+ $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
+ }
+ }
+
+ // Replace <DOT> with . for urls
+ $stuff_to_parse = str_replace('<DOT>', '.', $stuff_to_parse);
+ // Replace <|UR1| with <a href= for urls also
+ if (isset($this->link_styles[GESHI_LINK])) {
+ if ($this->use_classes) {
+ $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
+ }
+ else {
+ $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);
+ }
+ }
+ else {
+ $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
+ }
+
+ //
+ // NOW we add the span thingy ;)
+ //
+
+ $stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
+ $stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
+
+ return substr($stuff_to_parse, 1);
+ }
+
+ /**
+ * Sets the time taken to parse the code
+ *
* @param microtime The time when parsing started
* @param microtime The time when parsing ended
* @since 1.0.2
* @access private
- */
- function set_time ($start_time, $end_time)
- {
- $start = explode(' ', $start_time);
- $end = explode(' ', $end_time);
- $this->time = $end[0] + $end[1] - $start[0] - $start[1];
- }
-
- /**
- * Gets the time taken to parse the code
- *
+ */
+ function set_time($start_time, $end_time) {
+ $start = explode(' ', $start_time);
+ $end = explode(' ', $end_time);
+ $this->time = $end[0] + $end[1] - $start[0] - $start[1];
+ }
+
+ /**
+ * Gets the time taken to parse the code
+ *
* @return double The time taken to parse the code
* @since 1.0.2
- */
- function get_time ()
- {
- return $this->time;
- }
-
- /**
- * Gets language information and stores it for later use
- *
+ */
+ function get_time() {
+ return $this->time;
+ }
+
+ /**
+ * Gets language information and stores it for later use
+ *
* @access private
* @todo Needs to load keys for lexic permissions for keywords, regexps etc
- */
- function load_language ($file_name)
- {
+ */
+ function load_language($file_name) {
$this->enable_highlighting();
$language_data = array();
- require $file_name;
- // Perhaps some checking might be added here later to check that
- // $language data is a valid thing but maybe not
- $this->language_data = $language_data;
- // Set strict mode if should be set
- if ($this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS) {
- $this->strict_mode = true;
- }
- // Set permissions for all lexics to true
- // so they'll be highlighted by default
+ require $file_name;
+ // Perhaps some checking might be added here later to check that
+ // $language data is a valid thing but maybe not
+ $this->language_data = $language_data;
+ // Set strict mode if should be set
+ if ($this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS) {
+ $this->strict_mode = true;
+ }
+ // Set permissions for all lexics to true
+ // so they'll be highlighted by default
foreach ($this->language_data['KEYWORDS'] as $key => $words) {
$this->lexic_permissions['KEYWORDS'][$key] = true;
}
@@ -2234,34 +2241,33 @@ class GeSHi
foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
$this->lexic_permissions['REGEXPS'][$key] = true;
}
- // Set default class for CSS
- $this->overall_class = $this->language;
- }
+ // Set default class for CSS
+ $this->overall_class = $this->language;
+ }
- /**
- * Takes the parsed code and various options, and creates the HTML
- * surrounding it to make it look nice.
- *
+ /**
+ * Takes the parsed code and various options, and creates the HTML
+ * surrounding it to make it look nice.
+ *
* @param string The code already parsed
* @return string The code nicely finalised
* @since 1.0.0
* @access private
- */
- function finalise ($parsed_code)
- {
+ */
+ function finalise($parsed_code) {
// Remove end parts of important declarations
// This is BUGGY!! My fault for bad code: fix coming in 1.2
// @todo Remove this crap
if ($this->enable_important_blocks &&
- (strstr($parsed_code, @htmlspecialchars(GESHI_START_IMPORTANT, ENT_COMPAT, $this->encoding)) === false)) {
- $parsed_code = str_replace(@htmlspecialchars(GESHI_END_IMPORTANT, ENT_COMPAT, $this->encoding), '', $parsed_code);
+ (strstr($parsed_code, GeSHi::hsc(GESHI_START_IMPORTANT)) === false)) {
+ $parsed_code = str_replace(GeSHi::hsc(GESHI_END_IMPORTANT), '', $parsed_code);
}
-
+
// Add HTML whitespace stuff if we're using the <div> header
if ($this->header_type != GESHI_HEADER_PRE) {
$parsed_code = $this->indent($parsed_code);
}
-
+
// purge some unnecessary stuff
$parsed_code = preg_replace('#<span[^>]+>(\s*)</span>#', '\\1', $parsed_code);
$parsed_code = preg_replace('#<div[^>]+>(\s*)</div>#', '\\1', $parsed_code);
@@ -2271,11 +2277,11 @@ class GeSHi
if ($this->add_ids && !$this->overall_id) {
$this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4);
}
-
+
// If we're using line numbers, we insert <li>s and appropriate
// markup to style them (otherwise we don't need to do anything)
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- // If we're using the <pre> header, we shouldn't add newlines because
+ // If we're using the <pre> header, we shouldn't add newlines because
// the <pre> will line-break them (and the <li>s already do this for us)
$ls = ($this->header_type != GESHI_HEADER_PRE) ? "\n" : '';
// Get code into lines
@@ -2284,119 +2290,127 @@ class GeSHi
$parsed_code = '';
$i = 0;
$attrs = array();
-
+
// Foreach line...
- foreach ($code as $line) {//echo "LINE:|".htmlspecialchars($line)."| ".strlen($line)."<br />\n";
- if ('' == $line || ' ' == $line) {
+ foreach ($code as $line) {
+ // Make lines have at least one space in them if they're empty
+ // BenBE: Checking emptiness using trim instead of relying on blanks
+ if ('' == trim($line)) {
$line = '&nbsp;';
}
// If this is a "special line"...
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
+ if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
$i % $this->line_nth_row == ($this->line_nth_row - 1)) {
- // Set the attributes to style the line
+ // Set the attributes to style the line
if ($this->use_classes) {
- //$attr = ' class="li2"';
+ //$attr = ' class="li2"';
$attrs['class'][] = 'li2';
- $def_attr = ' class="de2"';
- } else {
- //$attr = ' style="' . $this->line_style2 . '"';
+ $def_attr = ' class="de2"';
+ }
+ else {
+ //$attr = ' style="' . $this->line_style2 . '"';
$attrs['style'][] = $this->line_style2;
- // This style "covers up" the special styles set for special lines
- // so that styles applied to special lines don't apply to the actual
- // code on that line
- $def_attr = ' style="' . $this->code_style . '"';
+ // This style "covers up" the special styles set for special lines
+ // so that styles applied to special lines don't apply to the actual
+ // code on that line
+ $def_attr = ' style="' . $this->code_style . '"';
}
- // Span or div?
- $start = "<div$def_attr>";
- $end = '</div>';
- } else {
- if ($this->use_classes) {
+ // Span or div?
+ $start = "<div$def_attr>";
+ $end = '</div>';
+ }
+ else {
+ if ($this->use_classes) {
//$attr = ' class="li1"';
$attrs['class'][] = 'li1';
- $def_attr = ' class="de1"';
- } else {
+ $def_attr = ' class="de1"';
+ }
+ else {
//$attr = ' style="' . $this->line_style1 . '"';
$attrs['style'][] = $this->line_style1;
- $def_attr = ' style="' . $this->code_style . '"';
- }
- $start = "<div$def_attr>";
- $end = '</div>';
- }
-
- ++$i;
- // Are we supposed to use ids? If so, add them
- if ($this->add_ids) {
+ $def_attr = ' style="' . $this->code_style . '"';
+ }
+ $start = "<div$def_attr>";
+ $end = '</div>';
+ }
+
+ ++$i;
+ // Are we supposed to use ids? If so, add them
+ if ($this->add_ids) {
$attrs['id'][] = "$this->overall_id-$i";
- }
- if ($this->use_classes && in_array($i, $this->highlight_extra_lines)) {
+ }
+ if ($this->use_classes && in_array($i, $this->highlight_extra_lines)) {
$attrs['class'][] = 'ln-xtra';
- }
- if (!$this->use_classes && in_array($i, $this->highlight_extra_lines)) {
+ }
+ if (!$this->use_classes && in_array($i, $this->highlight_extra_lines)) {
$attrs['style'][] = $this->highlight_extra_lines_style;
- }
+ }
- // Add in the line surrounded by appropriate list HTML
+ // Add in the line surrounded by appropriate list HTML
$attr_string = ' ';
foreach ($attrs as $key => $attr) {
$attr_string .= $key . '="' . implode(' ', $attr) . '" ';
}
$attr_string = substr($attr_string, 0, -1);
- $parsed_code .= "<li$attr_string>$start$line$end</li>$ls";
+ $parsed_code .= "<li$attr_string>$start$line$end</li>$ls";
$attrs = array();
- }
- } else {
+ }
+ }
+ else {
// No line numbers, but still need to handle highlighting lines extra.
// Have to use divs so the full width of the code is highlighted
$code = explode("\n", $parsed_code);
$parsed_code = '';
$i = 0;
foreach ($code as $line) {
- // Make lines have at least one space in them if they're empty
- if ('' == $line || ' ' == $line) {
+ // Make lines have at least one space in them if they're empty
+ // BenBE: Checking emptiness using trim instead of relying on blanks
+ if ('' == trim($line)) {
$line = '&nbsp;';
}
- if (in_array(++$i, $this->highlight_extra_lines)) {
- if ($this->use_classes) {
- $parsed_code .= '<div class="ln-xtra">';
- } else {
- $parsed_code .= "<div style=\"{$this->highlight_extra_lines_style}\">";
- }
+ if (in_array(++$i, $this->highlight_extra_lines)) {
+ if ($this->use_classes) {
+ $parsed_code .= '<div class="ln-xtra">';
+ }
+ else {
+ $parsed_code .= "<div style=\"{$this->highlight_extra_lines_style}\">";
+ }
// Remove \n because it stuffs up <pre> header
- $parsed_code .= $line . "</div>";
- } else {
- $parsed_code .= $line . "\n";
- }
- }
+ $parsed_code .= $line . "</div>";
+ }
+ else {
+ $parsed_code .= $line . "\n";
+ }
+ }
}
-
+
if ($this->header_type == GESHI_HEADER_PRE) {
- // enforce line numbers when using pre
+ // enforce line numbers when using pre
$parsed_code = str_replace('<li></li>', '<li>&nbsp;</li>', $parsed_code);
}
-
+
return $this->header() . chop($parsed_code) . $this->footer();
}
- /**
- * Creates the header for the code block (with correct attributes)
- *
+ /**
+ * Creates the header for the code block (with correct attributes)
+ *
* @return string The header for the code block
* @since 1.0.0
* @access private
- */
- function header ()
- {
- // Get attributes needed
- $attributes = $this->get_attributes();
+ */
+ function header() {
+ // Get attributes needed
+ $attributes = $this->get_attributes();
- $ol_attributes = '';
+ $ol_attributes = '';
- if ($this->line_numbers_start != 1) {
- $ol_attributes .= ' start="' . $this->line_numbers_start . '"';
- }
+ if ($this->line_numbers_start != 1) {
+ $ol_attributes .= ' start="' . $this->line_numbers_start . '"';
+ }
- // Get the header HTML
- $header = $this->format_header_content();
+ // Get the header HTML
+ $header = $this->format_header_content();
if (GESHI_HEADER_NONE == $this->header_type) {
if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
@@ -2404,288 +2418,362 @@ class GeSHi
}
return $header;
}
-
- // Work out what to return and do it
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- if ($this->header_type == GESHI_HEADER_PRE) {
- return "<pre$attributes>$header<ol$ol_attributes>";
- } elseif ($this->header_type == GESHI_HEADER_DIV) {
- return "<div$attributes>$header<ol$ol_attributes>";
- }
- } else {
- if ($this->header_type == GESHI_HEADER_PRE) {
- return "<pre$attributes>$header";
- } elseif ($this->header_type == GESHI_HEADER_DIV) {
- return "<div$attributes>$header";
- }
- }
- }
-
- /**
- * Returns the header content, formatted for output
- *
+
+ // Work out what to return and do it
+ if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+ if ($this->header_type == GESHI_HEADER_PRE) {
+ return "<pre$attributes>$header<ol$ol_attributes>";
+ }
+ else if ($this->header_type == GESHI_HEADER_DIV) {
+ return "<div$attributes>$header<ol$ol_attributes>";
+ }
+ }
+ else {
+ if ($this->header_type == GESHI_HEADER_PRE) {
+ return "<pre$attributes>$header";
+ }
+ else if ($this->header_type == GESHI_HEADER_DIV) {
+ return "<div$attributes>$header";
+ }
+ }
+ }
+
+ /**
+ * Returns the header content, formatted for output
+ *
* @return string The header content, formatted for output
* @since 1.0.2
* @access private
- */
- function format_header_content ()
- {
- $header = $this->header_content;
- if ($header) {
- if ($this->header_type == GESHI_HEADER_PRE) {
- $header = str_replace("\n", '', $header);
- }
- $header = $this->replace_keywords($header);
-
- if ($this->use_classes) {
- $attr = ' class="head"';
- } else {
- $attr = " style=\"{$this->header_content_style}\"";
- }
- return "<div$attr>$header</div>";
- }
- }
-
- /**
- * Returns the footer for the code block.
- *
+ */
+ function format_header_content() {
+ $header = $this->header_content;
+ if ($header) {
+ if ($this->header_type == GESHI_HEADER_PRE) {
+ $header = str_replace("\n", '', $header);
+ }
+ $header = $this->replace_keywords($header);
+
+ if ($this->use_classes) {
+ $attr = ' class="head"';
+ }
+ else {
+ $attr = " style=\"{$this->header_content_style}\"";
+ }
+ return "<div$attr>$header</div>";
+ }
+ }
+
+ /**
+ * Returns the footer for the code block.
+ *
* @return string The footer for the code block
* @since 1.0.0
* @access private
- */
- function footer ()
- {
- $footer_content = $this->format_footer_content();
+ */
+ function footer() {
+ $footer_content = $this->format_footer_content();
if (GESHI_HEADER_NONE == $this->header_type) {
return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer_content
: $footer_content;
}
-
- if ($this->header_type == GESHI_HEADER_DIV) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "</ol>$footer_content</div>";
- }
- return "$footer_content</div>";
- } else {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "</ol>$footer_content</pre>";
- }
- return "$footer_content</pre>";
- }
- }
-
- /**
- * Returns the footer content, formatted for output
- *
+
+ if ($this->header_type == GESHI_HEADER_DIV) {
+ if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+ return "</ol>$footer_content</div>";
+ }
+ return "$footer_content</div>";
+ }
+ else {
+ if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+ return "</ol>$footer_content</pre>";
+ }
+ return "$footer_content</pre>";
+ }
+ }
+
+ /**
+ * Returns the footer content, formatted for output
+ *
* @return string The footer content, formatted for output
* @since 1.0.2
* @access private
- */
- function format_footer_content ()
- {
- $footer = $this->footer_content;
- if ($footer) {
- if ($this->header_type == GESHI_HEADER_PRE) {
- $footer = str_replace("\n", '', $footer);;
- }
- $footer = $this->replace_keywords($footer);
-
- if ($this->use_classes) {
- $attr = ' class="foot"';
- } else {
- $attr = " style=\"{$this->footer_content_style}\"";
- }
- return "<div$attr>$footer</div>";
- }
- }
-
- /**
- * Replaces certain keywords in the header and footer with
- * certain configuration values
- *
+ */
+ function format_footer_content() {
+ $footer = $this->footer_content;
+ if ($footer) {
+ if ($this->header_type == GESHI_HEADER_PRE) {
+ $footer = str_replace("\n", '', $footer);;
+ }
+ $footer = $this->replace_keywords($footer);
+
+ if ($this->use_classes) {
+ $attr = ' class="foot"';
+ }
+ else {
+ $attr = " style=\"{$this->footer_content_style}\"";
+ }
+ return "<div$attr>$footer</div>";
+ }
+ }
+
+ /**
+ * Replaces certain keywords in the header and footer with
+ * certain configuration values
+ *
* @param string The header or footer content to do replacement on
* @return string The header or footer with replaced keywords
* @since 1.0.2
* @access private
- */
- function replace_keywords ($instr)
- {
- $keywords = $replacements = array();
+ */
+ function replace_keywords($instr) {
+ $keywords = $replacements = array();
- $keywords[] = '<TIME>';
- $replacements[] = number_format($this->get_time(), 3);
+ $keywords[] = '<TIME>';
+ $replacements[] = number_format($this->get_time(), 3);
- $keywords[] = '<LANGUAGE>';
- $replacements[] = $this->language;
+ $keywords[] = '<LANGUAGE>';
+ $replacements[] = $this->language;
- $keywords[] = '<VERSION>';
- $replacements[] = GESHI_VERSION;
+ $keywords[] = '<VERSION>';
+ $replacements[] = GESHI_VERSION;
- return str_replace($keywords, $replacements, $instr);
- }
+ return str_replace($keywords, $replacements, $instr);
+ }
- /**
- * Gets the CSS attributes for this code
- *
+ /**
+ * Gets the CSS attributes for this code
+ *
* @return The CSS attributes for this code
* @since 1.0.0
* @access private
* @todo Document behaviour change - class is outputted regardless of whether we're using classes or not.
* Same with style
- */
- function get_attributes ()
- {
- $attributes = '';
-
- if ($this->overall_class != '') {
- $attributes .= " class=\"{$this->overall_class}\"";
- }
- if ($this->overall_id != '') {
- $attributes .= " id=\"{$this->overall_id}\"";
- }
- if ($this->overall_style != '') {
- $attributes .= ' style="' . $this->overall_style . '"';
- }
- return $attributes;
- }
-
- /**
- * Returns a stylesheet for the highlighted code. If $economy mode
- * is true, we only return the stylesheet declarations that matter for
- * this code block instead of the whole thing
- *
- * @param boolean Whether to use economy mode or not
+ */
+ function get_attributes() {
+ $attributes = '';
+
+ if ($this->overall_class != '') {
+ $attributes .= " class=\"{$this->overall_class}\"";
+ }
+ if ($this->overall_id != '') {
+ $attributes .= " id=\"{$this->overall_id}\"";
+ }
+ if ($this->overall_style != '') {
+ $attributes .= ' style="' . $this->overall_style . '"';
+ }
+ return $attributes;
+ }
+
+ /**
+ * Secure replacement for PHP built-in function htmlspecialchars().
+ *
+ * See ticket #427 (http://wush.net/trac/wikka/ticket/427) for the rationale
+ * for this replacement function.
+ *
+ * The INTERFACE for this function is almost the same as that for
+ * htmlspecialchars(), with the same default for quote style; however, there
+ * is no 'charset' parameter. The reason for this is as follows:
+ *
+ * The PHP docs say:
+ * "The third argument charset defines character set used in conversion."
+ *
+ * I suspect PHP's htmlspecialchars() is working at the byte-value level and
+ * thus _needs_ to know (or asssume) a character set because the special
+ * characters to be replaced could exist at different code points in
+ * different character sets. (If indeed htmlspecialchars() works at
+ * byte-value level that goes some way towards explaining why the
+ * vulnerability would exist in this function, too, and not only in
+ * htmlentities() which certainly is working at byte-value level.)
+ *
+ * This replacement function however works at character level and should
+ * therefore be "immune" to character set differences - so no charset
+ * parameter is needed or provided. If a third parameter is passed, it will
+ * be silently ignored.
+ *
+ * In the OUTPUT there is a minor difference in that we use '&#39;' instead
+ * of PHP's '&#039;' for a single quote: this provides compatibility with
+ * get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES)
+ * (see comment by mikiwoz at yahoo dot co dot uk on
+ * http://php.net/htmlspecialchars); it also matches the entity definition
+ * for XML 1.0
+ * (http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters).
+ * Like PHP we use a numeric character reference instead of '&apos;' for the
+ * single quote. For the other special characters we use the named entity
+ * references, as PHP is doing.
+ *
+ * @author {@link http://wikkawiki.org/JavaWoman Marjolein Katsma}
+ *
+ * @license http://www.gnu.org/copyleft/lgpl.html
+ * GNU Lesser General Public License
+ * @copyright Copyright 2007, {@link http://wikkawiki.org/CreditsPage
+ * Wikka Development Team}
+ *
+ * @access public
+ * @param string $string string to be converted
+ * @param integer $quote_style
+ * - ENT_COMPAT: escapes &, <, > and double quote (default)
+ * - ENT_NOQUOTES: escapes only &, < and >
+ * - ENT_QUOTES: escapes &, <, >, double and single quotes
+ * @return string converted string
+ */
+ function hsc($string, $quote_style=ENT_COMPAT) {
+ // init
+ $aTransSpecchar = array(
+ '&' => '&amp;',
+ '"' => '&quot;',
+ '<' => '&lt;',
+ '>' => '&gt;'
+ ); // ENT_COMPAT set
+
+ if (ENT_NOQUOTES == $quote_style) // don't convert double quotes
+ {
+ unset($aTransSpecchar['"']);
+ }
+ elseif (ENT_QUOTES == $quote_style) // convert single quotes as well
+ {
+ $aTransSpecchar["'"] = '&#39;'; // (apos) htmlspecialchars() uses '&#039;'
+ }
+
+ // return translated string
+ return strtr($string,$aTransSpecchar);
+ }
+
+ /**
+ * Returns a stylesheet for the highlighted code. If $economy mode
+ * is true, we only return the stylesheet declarations that matter for
+ * this code block instead of the whole thing
+ *
+ * @param boolean Whether to use economy mode or not
* @return string A stylesheet built on the data for the current language
* @since 1.0.0
- */
- function get_stylesheet ($economy_mode = true)
- {
- // If there's an error, chances are that the language file
- // won't have populated the language data file, so we can't
- // risk getting a stylesheet...
- if ($this->error) {
- return '';
- }
- // First, work out what the selector should be. If there's an ID,
- // that should be used, the same for a class. Otherwise, a selector
- // of '' means that these styles will be applied anywhere
- $selector = ($this->overall_id != '') ? "#{$this->overall_id} " : '';
- $selector = ($selector == '' && $this->overall_class != '') ? ".{$this->overall_class} " : $selector;
-
- // Header of the stylesheet
- if (!$economy_mode) {
- $stylesheet = "/**\n * GeSHi Dynamically Generated Stylesheet\n * --------------------------------------\n * Dynamically generated stylesheet for {$this->language}\n * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n * GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter)\n */\n";
- } else {
- $stylesheet = '/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */' . "\n";
- }
-
- // Set the <ol> to have no effect at all if there are line numbers
- // (<ol>s have margins that should be destroyed so all layout is
- // controlled by the set_overall_style method, which works on the
- // <pre> or <div> container). Additionally, set default styles for lines
- if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n";
- $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n";
- }
-
- // Add overall styles
- if (!$economy_mode || $this->overall_style != '') {
- $stylesheet .= "$selector {{$this->overall_style}}\n";
- }
-
- // Add styles for links
- foreach ($this->link_styles as $key => $style) {
- if (!$economy_mode || $key == GESHI_LINK && $style != '') {
- $stylesheet .= "{$selector}a:link {{$style}}\n";
- }
- if (!$economy_mode || $key == GESHI_HOVER && $style != '') {
- $stylesheet .= "{$selector}a:hover {{$style}}\n";
- }
- if (!$economy_mode || $key == GESHI_ACTIVE && $style != '') {
- $stylesheet .= "{$selector}a:active {{$style}}\n";
- }
- if (!$economy_mode || $key == GESHI_VISITED && $style != '') {
- $stylesheet .= "{$selector}a:visited {{$style}}\n";
- }
- }
-
- // Header and footer
- if (!$economy_mode || $this->header_content_style != '') {
- $stylesheet .= "$selector.head {{$this->header_content_style}}\n";
- }
- if (!$economy_mode || $this->footer_content_style != '') {
- $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n";
- }
-
- // Styles for important stuff
- if (!$economy_mode || $this->important_styles != '') {
- $stylesheet .= "$selector.imp {{$this->important_styles}}\n";
- }
-
- // Styles for lines being highlighted extra
- if (!$economy_mode || count($this->highlight_extra_lines)) {
- $stylesheet .= "$selector.ln-xtra {{$this->highlight_extra_lines_style}}\n";
- }
-
- // Simple line number styles
- if (!$economy_mode || ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->line_style1 != '')) {
- $stylesheet .= "{$selector}li {{$this->line_style1}}\n";
- }
-
- // If there is a style set for fancy line numbers, echo it out
- if (!$economy_mode || ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $this->line_style2 != '')) {
- $stylesheet .= "{$selector}li.li2 {{$this->line_style2}}\n";
- }
-
- foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && (!$this->lexic_permissions['KEYWORDS'][$group] || $styles == ''))) {
- $stylesheet .= "$selector.kw$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') &&
+ */
+ function get_stylesheet($economy_mode = true) {
+ // If there's an error, chances are that the language file
+ // won't have populated the language data file, so we can't
+ // risk getting a stylesheet...
+ if ($this->error) {
+ return '';
+ }
+ // First, work out what the selector should be. If there's an ID,
+ // that should be used, the same for a class. Otherwise, a selector
+ // of '' means that these styles will be applied anywhere
+ $selector = ($this->overall_id != '') ? "#{$this->overall_id} " : '';
+ $selector = ($selector == '' && $this->overall_class != '') ? ".{$this->overall_class} " : $selector;
+
+ // Header of the stylesheet
+ if (!$economy_mode) {
+ $stylesheet = "/**\n * GeSHi Dynamically Generated Stylesheet\n * --------------------------------------\n * Dynamically generated stylesheet for {$this->language}\n * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n * GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter)\n */\n";
+ } else {
+ $stylesheet = '/* GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter) */' . "\n";
+ }
+
+ // Set the <ol> to have no effect at all if there are line numbers
+ // (<ol>s have margins that should be destroyed so all layout is
+ // controlled by the set_overall_style method, which works on the
+ // <pre> or <div> container). Additionally, set default styles for lines
+ if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+ //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n";
+ $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n";
+ }
+
+ // Add overall styles
+ if (!$economy_mode || $this->overall_style != '') {
+ $stylesheet .= "$selector {{$this->overall_style}}\n";
+ }
+
+ // Add styles for links
+ foreach ($this->link_styles as $key => $style) {
+ if (!$economy_mode || $key == GESHI_LINK && $style != '') {
+ $stylesheet .= "{$selector}a:link {{$style}}\n";
+ }
+ if (!$economy_mode || $key == GESHI_HOVER && $style != '') {
+ $stylesheet .= "{$selector}a:hover {{$style}}\n";
+ }
+ if (!$economy_mode || $key == GESHI_ACTIVE && $style != '') {
+ $stylesheet .= "{$selector}a:active {{$style}}\n";
+ }
+ if (!$economy_mode || $key == GESHI_VISITED && $style != '') {
+ $stylesheet .= "{$selector}a:visited {{$style}}\n";
+ }
+ }
+
+ // Header and footer
+ if (!$economy_mode || $this->header_content_style != '') {
+ $stylesheet .= "$selector.head {{$this->header_content_style}}\n";
+ }
+ if (!$economy_mode || $this->footer_content_style != '') {
+ $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n";
+ }
+
+ // Styles for important stuff
+ if (!$economy_mode || $this->important_styles != '') {
+ $stylesheet .= "$selector.imp {{$this->important_styles}}\n";
+ }
+
+ // Styles for lines being highlighted extra
+ if (!$economy_mode || count($this->highlight_extra_lines)) {
+ $stylesheet .= "$selector.ln-xtra {{$this->highlight_extra_lines_style}}\n";
+ }
+
+ // Simple line number styles
+ if (!$economy_mode || ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->line_style1 != '')) {
+ $stylesheet .= "{$selector}li {{$this->line_style1}}\n";
+ }
+
+ // If there is a style set for fancy line numbers, echo it out
+ if (!$economy_mode || ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $this->line_style2 != '')) {
+ $stylesheet .= "{$selector}li.li2 {{$this->line_style2}}\n";
+ }
+
+ foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && (!$this->lexic_permissions['KEYWORDS'][$group] || $styles == ''))) {
+ $stylesheet .= "$selector.kw$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') &&
!($economy_mode && !$this->lexic_permissions['COMMENTS'][$group])) {
- $stylesheet .= "$selector.co$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.co$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['ESCAPE_CHAR'])) {
- $stylesheet .= "$selector.es$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.es$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['BRACKETS'])) {
- $stylesheet .= "$selector.br$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.br$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['STRINGS'])) {
- $stylesheet .= "$selector.st$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.st$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['NUMBERS'])) {
- $stylesheet .= "$selector.nu$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.nu$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['METHODS'])) {
- $stylesheet .= "$selector.me$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '')) {
- $stylesheet .= "$selector.sc$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) {
- if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
+ $stylesheet .= "$selector.me$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '')) {
+ $stylesheet .= "$selector.sc$group {{$styles}}\n";
+ }
+ }
+ foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) {
+ if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
!$this->lexic_permissions['REGEXPS'][$group])) {
if (is_array($this->language_data['REGEXPS'][$group]) &&
array_key_exists(GESHI_CLASS,
@@ -2693,22 +2781,23 @@ class GeSHi
$stylesheet .= "$selector.";
$stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS];
$stylesheet .= " {{$styles}}\n";
- } else {
- $stylesheet .= "$selector.re$group {{$styles}}\n";
}
- }
- }
+ else {
+ $stylesheet .= "$selector.re$group {{$styles}}\n";
+ }
+ }
+ }
- return $stylesheet;
- }
+ return $stylesheet;
+ }
} // End Class GeSHi
if (!function_exists('geshi_highlight')) {
- /**
+ /**
* Easy way to highlight stuff. Behaves just like highlight_string
- *
+ *
* @param string The code to highlight
* @param string The language to highlight the code in
* @param string The path to the language files. You can leave this blank if you need
@@ -2717,19 +2806,18 @@ if (!function_exists('geshi_highlight')) {
* @return string The code highlighted (if $return is true)
* @since 1.0.2
*/
- function geshi_highlight ($string, $language, $path = null, $return = false)
- {
- $geshi = new GeSHi($string, $language, $path);
- $geshi->set_header_type(GESHI_HEADER_NONE);
- if ($return) {
- return '<code>' . $geshi->parse_code() . '</code>';
- }
- echo '<code>' . $geshi->parse_code() . '</code>';
- if ($geshi->error()) {
- return false;
- }
- return true;
- }
+ function geshi_highlight($string, $language, $path = null, $return = false) {
+ $geshi = new GeSHi($string, $language, $path);
+ $geshi->set_header_type(GESHI_HEADER_NONE);
+ if ($return) {
+ return '<code>' . $geshi->parse_code() . '</code>';
+ }
+ echo '<code>' . $geshi->parse_code() . '</code>';
+ if ($geshi->error()) {
+ return false;
+ }
+ return true;
+ }
}
?>
diff --git a/inc/geshi/actionscript.php b/inc/geshi/actionscript.php
index 78546bcc5..9076e1bdd 100644
--- a/inc/geshi/actionscript.php
+++ b/inc/geshi/actionscript.php
@@ -4,10 +4,8 @@
* ----------------
* Author: Steffen Krause (Steffen.krause@muse.de)
* Copyright: (c) 2004 Steffen Krause, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Actionscript language file for GeSHi.
*
diff --git a/inc/geshi/ada.php b/inc/geshi/ada.php
index 50ba8e3bc..e7e2e62e3 100644
--- a/inc/geshi/ada.php
+++ b/inc/geshi/ada.php
@@ -4,10 +4,8 @@
* -------
* Author: Tux (tux@inmail.cz)
* Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/29
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Ada language file for GeSHi.
* Words are from SciTe configuration file
diff --git a/inc/geshi/apache.php b/inc/geshi/apache.php
index 4371db920..d6c1ee29d 100644
--- a/inc/geshi/apache.php
+++ b/inc/geshi/apache.php
@@ -4,10 +4,8 @@
* ----------
* Author: Tux (tux@inmail.cz)
* Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/29/07
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Apache language file for GeSHi.
* Words are from SciTe configuration file
diff --git a/inc/geshi/applescript.php b/inc/geshi/applescript.php
index 664c53ba6..521d966f6 100644
--- a/inc/geshi/applescript.php
+++ b/inc/geshi/applescript.php
@@ -4,10 +4,8 @@
* --------
* Author: Stephan Klimek (http://www.initware.org)
* Copyright: Stephan Klimek (http://www.initware.org)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/07/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* AppleScript language file for GeSHi.
*
diff --git a/inc/geshi/asm.php b/inc/geshi/asm.php
index b0002189c..1999ec271 100644
--- a/inc/geshi/asm.php
+++ b/inc/geshi/asm.php
@@ -4,10 +4,8 @@
* -------
* Author: Tux (tux@inmail.cz)
* Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/27
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* x86 Assembler language file for GeSHi.
* Words are from SciTe configuration file (based on NASM syntax)
diff --git a/inc/geshi/asp.php b/inc/geshi/asp.php
index 94fd6e5fb..5c0371186 100644
--- a/inc/geshi/asp.php
+++ b/inc/geshi/asp.php
@@ -4,10 +4,8 @@
* --------
* Author: Amit Gupta (http://blog.igeek.info/)
* Copyright: (c) 2004 Amit Gupta (http://blog.igeek.info/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/13
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* ASP language file for GeSHi.
*
diff --git a/inc/geshi/autoit.php b/inc/geshi/autoit.php
index 06a4f6ec3..c93a6a2fa 100644
--- a/inc/geshi/autoit.php
+++ b/inc/geshi/autoit.php
@@ -2,14 +2,13 @@
/*************************************************************************************
* autoit.php
* --------
- * Author: mastrboy
+ * Author: big_daddy (robert.i.anthony@gmail.com)
* Copyright: (c) 2006 and to GESHi ;)
- * Release Version: 1.0.7.17
+ * Release Version: 1.0.7.18
* Date Started: 26.01.2006
*
* Current bugs & todo:
* ----------
- * - can't get #cs and #ce to work as multiple comments while still #comments-start/end working
* - dosn't highlight symbols (Please note that in 1.0.X these are not used. Hopefully they will be used in 1.2.X.)
* - not sure how to get sendkeys to work " {!}, {SPACE} etc... "
* - jut copyied the regexp for variable from php so this HAVE to be checked and fixed to a better one ;)
@@ -36,160 +35,419 @@
************************************************************************************/
$language_data = array (
- 'LANG_NAME' => 'AutoIT',
- 'COMMENT_SINGLE' => array(';'),
- 'COMMENT_MULTI' => array('#comments-start' => '#comments-end'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
+ 'LANG_NAME' => 'AutoIt',
+ 'COMMENT_SINGLE' => array(';'),
+ 'COMMENT_MULTI' => array('#comments-start' => '#comments-end', '#cs' => '#ce'),
+ 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+ 'QUOTEMARKS' => array("'", '"'),
'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'continueloop', 'and', 'byref', 'case', 'const', 'dim', 'do', 'else',
- 'elseif', 'endfunc', 'endif', 'endselect', 'exit', 'exitloop', 'for',
- 'func', 'global', 'if', 'local', 'next', 'not', 'or', 'redim', 'return',
- 'select', 'step', 'then', 'to', 'until', 'wend', 'while'
- ),
- 2 => array(
- '@appdatacommondir','@appdatadir','@autoitexe','@autoitversion','@commonfilesdir',
- '@compiled','@computername','@comspec','@cr','@crlf','@desktopcommondir','@desktopdepth','@desktopdir',
- '@desktopheight','@desktoprefresh','@desktopwidth','@documentscommondir','@error','@extended',
- '@favoritescommondir','@favoritesdir','@gui_ctrlhandle','@gui_ctrlid','@gui_winhandle','@homedrive',
- '@homepath','@homeshare','@hour','@inetgetactive','@inetgetbytesread','@ipaddress1','@ipaddress2',
- '@ipaddress3','@ipaddress4','@lf','@logondnsdomain','@logondomain','@logonserver','@mday','@min',
- '@mon','@mydocumentsdir','@numparams','@osbuild','@oslang','@osservicepack','@ostype','@osversion',
- '@programfilesdir','@programscommondir','@programsdir','@scriptdir','@scriptfullpath','@scriptname',
- '@sec','@startmenucommondir','@startmenudir','@startupcommondir','@startupdir','@sw_disable',
- '@sw_enable','@sw_hide','@sw_maximize','@sw_minimize','@sw_restore','@sw_show','@sw_showdefault',
- '@sw_showmaximized','@sw_showminimized','@sw_showminnoactive','@sw_showna','@sw_shownoactivate',
- '@sw_shownormal','@systemdir','@tab','@tempdir','@username','@userprofiledir','@wday','@windowsdir',
- '@workingdir','@yday','@year'
- ),
- 3 => array(
- 'abs','acos','adlibdisable','adlibenable','asc','asin','assign','atan','autoitsetoption',
- 'autoitwingettitle','autoitwinsettitle','bitand','bitnot','bitor','bitshift','bitxor','blockinput',
- 'break','call','cdtray','chr','clipget','clipput','consolewrite','controlclick','controlcommand','controldisable',
- 'controlenable','controlfocus','controlgetfocus','controlgethandle','controlgetpos','controlgettext',
- 'controlhide','controllistview','controlmove','controlsend','controlsettext','controlshow','cos',
- 'dec','dircopy','dircreate','dirgetsize','dirmove','dirremove','dllcall','dllclose','dllopen','drivegetdrive',
- 'drivegetfilesystem','drivegetlabel','drivegetserial','drivegettype','drivemapadd','drivemapdel',
- 'drivemapget','drivesetlabel','drivespacefree','drivespacetotal','drivestatus','envget','envset',
- 'envupdate','eval','exp','filechangedir','fileclose','filecopy','filecreateshortcut','filedelete',
- 'fileexists','filefindfirstfile','filefindnextfile','filegetattrib','filegetlongname','filegetshortcut',
- 'filegetshortname','filegetsize','filegettime','filegetversion','fileinstall','filemove','fileopen',
- 'fileopendialog','fileread','filereadline','filerecycle','filerecycleempty','filesavedialog',
- 'fileselectfolder','filesetattrib','filesettime','filewrite','filewriteline','ftpsetproxy','guicreate',
- 'guictrlcreateavi','guictrlcreatebutton','guictrlcreatecheckbox','guictrlcreatecombo','guictrlcreatecontextmenu',
- 'guictrlcreatedate','guictrlcreatedummy','guictrlcreateedit','guictrlcreategroup','guictrlcreateicon',
- 'guictrlcreateinput','guictrlcreatelabel','guictrlcreatelist','guictrlcreatelistview','guictrlcreatelistviewitem',
- 'guictrlcreatemenu','guictrlcreatemenuitem','guictrlcreatepic','guictrlcreateprogress','guictrlcreateradio',
- 'guictrlcreateslider','guictrlcreatetab','guictrlcreatetabitem','guictrlcreatetreeview','guictrlcreatetreeviewitem',
- 'guictrlcreateupdown','guictrldelete','guictrlgetstate','guictrlread','guictrlrecvmsg','guictrlsendmsg',
- 'guictrlsendtodummy','guictrlsetbkcolor','guictrlsetcolor','guictrlsetcursor','guictrlsetdata',
- 'guictrlsetfont','guictrlsetimage','guictrlsetlimit','guictrlsetonevent','guictrlsetpos','guictrlsetresizing',
- 'guictrlsetstate','guictrlsetstyle','guictrlsettip','guidelete','guigetcursorinfo','guigetmsg',
- 'guisetbkcolor','guisetcoord','guisetcursor','guisetfont','guisethelp','guiseticon','guisetonevent',
- 'guisetstate','guistartgroup','guiswitch','hex','hotkeyset','httpsetproxy','inetget','inetgetsize',
- 'inidelete','iniread','inireadsection','inireadsectionnames','iniwrite','inputbox','int','isadmin',
- 'isarray','isdeclared','isfloat','isint','isnumber','isstring','log','memgetstats','mod','mouseclick',
- 'mouseclickdrag','mousedown','mousegetcursor','mousegetpos','mousemove','mouseup','mousewheel',
- 'msgbox','number','opt','ping','pixelchecksum','pixelgetcolor','pixelsearch','processclose','processexists',
- 'processlist','processsetpriority','processwait','processwaitclose','progressoff','progresson',
- 'progressset','random','regdelete','regenumkey','regenumval','regread','regwrite','round','run','runasset',
- 'runwait','send','seterror','setextended','shutdown','sin','sleep','soundplay','soundsetwavevolume',
- 'splashimageon','splashoff','splashtexton','sqrt','statusbargettext','string','stringaddcr','stringformat',
- 'stringinstr','stringisalnum','stringisalpha','stringisascii','stringisdigit','stringisfloat',
- 'stringisint','stringislower','stringisspace','stringisupper','stringisxdigit','stringleft','stringlen',
- 'stringlower','stringmid','stringregexp','stringregexpreplace','stringreplace','stringright',
- 'stringsplit','stringstripcr','stringstripws','stringtrimleft','stringtrimright','stringupper',
- 'tan','timerdiff','timerinit','timerstart','timerstop','tooltip','traytip','ubound','winactivate','winactive',
- 'winclose','winexists','wingetcaretpos','wingetclasslist','wingetclientsize','wingethandle','wingetpos',
- 'wingetprocess','wingetstate','wingettext','wingettitle','winkill','winlist','winmenuselectitem',
- 'winminimizeall','winminimizeallundo','winmove','winsetontop','winsetstate','winsettitle','winsettrans',
- 'winshow','winwait','winwaitactive','winwaitclose','winwaitnotactive'
- )
+ 'KEYWORDS' => array(
+ 1 => array(
+ 'false', 'and', 'byref', 'case', 'const',
+ 'continuecase', 'continueloop', 'default', 'dim', 'do',
+ 'else', 'elseif', 'endfunc', 'endif', 'endselect',
+ 'endswitch', 'endwith', 'enum', 'exit', 'exitloop',
+ 'for', 'func', 'global', 'if', 'in',
+ 'local', 'next', 'not', 'or', 'redim',
+ 'return', 'select', 'step', 'switch', 'then',
+ 'to', 'true', 'until', 'wend', 'while',
+ 'with'
+ ),
+ 2 => array(
+ '@appdatacommondir', '@appdatadir', '@autoitexe', '@autoitpid',
+ '@autoitversion', '@com_eventobj', '@commonfilesdir', '@compiled',
+ '@computername', '@comspec', '@cr', '@crlf', '@desktopcommondir',
+ '@desktopdepth', '@desktopdir', '@desktopheight',
+ '@desktoprefresh', '@desktopwidth', '@documentscommondir',
+ '@error', '@exitcode', '@exitmethod', '@extended',
+ '@favoritescommondir', '@favoritesdir', '@gui_ctrlhandle',
+ '@gui_ctrlid', '@gui_dragfile', '@gui_dragid', '@gui_dropid',
+ '@gui_winhandle', '@homedrive', '@homepath', '@homeshare',
+ '@hotkeypressed', '@hour', '@inetgetactive', '@inetgetbytesread',
+ '@ipaddress1', '@ipaddress2', '@ipaddress3', '@ipaddress4',
+ '@kblayout', '@lf', '@logondnsdomain', '@logondomain',
+ '@logonserver', '@mday', '@min', '@mon', '@mydocumentsdir',
+ '@numparams', '@osbuild', '@oslang', '@osservicepack', '@ostype',
+ '@osversion', '@processorarch', '@programfilesdir',
+ '@programscommondir', '@programsdir', '@scriptdir',
+ '@scriptfullpath', '@scriptlinenumber', '@scriptname', '@sec',
+ '@startmenucommondir', '@startmenudir', '@startupcommondir',
+ '@startupdir', '@sw_disable', '@sw_enable', '@sw_hide', '@sw_lock',
+ '@sw_maximize', '@sw_minimize', '@sw_restore', '@sw_show',
+ '@sw_showdefault', '@sw_showmaximized', '@sw_showminimized',
+ '@sw_showminnoactive', '@sw_showna', '@sw_shownoactivate',
+ '@sw_shownormal', '@sw_unlock', '@systemdir', '@tab', '@tempdir',
+ '@tray_id', '@trayiconflashing', '@trayiconvisible', '@username',
+ '@userprofiledir', '@wday', '@windowsdir', '@workingdir', '@yday',
+ '@year'
+ ),
+ 3 => array(
+ 'abs', 'acos', 'adlibdisable', 'adlibenable', 'asc', 'asin',
+ 'assign', 'atan', 'autoitsetoption', 'autoitwingettitle',
+ 'autoitwinsettitle', 'beep', 'binarystring', 'bitand', 'bitnot',
+ 'bitor', 'bitrotate', 'bitshift', 'bitxor', 'blockinput', 'break',
+ 'call', 'cdtray', 'ceiling', 'chr', 'clipget', 'clipput',
+ 'consoleread', 'consolewrite', 'consolewriteerror', 'controlclick',
+ 'controlcommand', 'controldisable', 'controlenable',
+ 'controlfocus', 'controlgetfocus', 'controlgethandle',
+ 'controlgetpos', 'controlgettext', 'controlhide',
+ 'controllistview', 'controlmove', 'controlsend', 'controlsettext',
+ 'controlshow', 'cos', 'dec', 'dircopy', 'dircreate', 'dirgetsize',
+ 'dirmove', 'dirremove', 'dllcall', 'dllclose', 'dllopen',
+ 'dllstructcreate', 'dllstructgetdata', 'dllstructgetptr',
+ 'dllstructgetsize', 'dllstructsetdata', 'drivegetdrive',
+ 'drivegetfilesystem', 'drivegetlabel', 'drivegetserial',
+ 'drivegettype', 'drivemapadd', 'drivemapdel', 'drivemapget',
+ 'drivesetlabel', 'drivespacefree', 'drivespacetotal',
+ 'drivestatus', 'envget', 'envset', 'envupdate', 'eval', 'execute',
+ 'exp', 'filechangedir', 'fileclose', 'filecopy',
+ 'filecreatentfslink', 'filecreateshortcut', 'filedelete',
+ 'fileexists', 'filefindfirstfile', 'filefindnextfile',
+ 'filegetattrib', 'filegetlongname', 'filegetshortcut',
+ 'filegetshortname', 'filegetsize', 'filegettime', 'filegetversion',
+ 'fileinstall', 'filemove', 'fileopen', 'fileopendialog',
+ 'fileread', 'filereadline', 'filerecycle', 'filerecycleempty',
+ 'filesavedialog', 'fileselectfolder', 'filesetattrib',
+ 'filesettime', 'filewrite', 'filewriteline', 'floor',
+ 'ftpsetproxy', 'guicreate', 'guictrlcreateavi',
+ 'guictrlcreatebutton', 'guictrlcreatecheckbox',
+ 'guictrlcreatecombo', 'guictrlcreatecontextmenu',
+ 'guictrlcreatedate', 'guictrlcreatedummy', 'guictrlcreateedit',
+ 'guictrlcreategraphic', 'guictrlcreategroup', 'guictrlcreateicon',
+ 'guictrlcreateinput', 'guictrlcreatelabel', 'guictrlcreatelist',
+ 'guictrlcreatelistview', 'guictrlcreatelistviewitem',
+ 'guictrlcreatemenu', 'guictrlcreatemenuitem',
+ 'guictrlcreatemonthcal', 'guictrlcreateobj', 'guictrlcreatepic',
+ 'guictrlcreateprogress', 'guictrlcreateradio',
+ 'guictrlcreateslider', 'guictrlcreatetab', 'guictrlcreatetabitem',
+ 'guictrlcreatetreeview', 'guictrlcreatetreeviewitem',
+ 'guictrlcreateupdown', 'guictrldelete', 'guictrlgethandle',
+ 'guictrlgetstate', 'guictrlread', 'guictrlrecvmsg',
+ 'guictrlregisterlistviewsort', 'guictrlsendmsg',
+ 'guictrlsendtodummy', 'guictrlsetbkcolor', 'guictrlsetcolor',
+ 'guictrlsetcursor', 'guictrlsetdata', 'guictrlsetfont',
+ 'guictrlsetgraphic', 'guictrlsetimage', 'guictrlsetlimit',
+ 'guictrlsetonevent', 'guictrlsetpos', 'guictrlsetresizing',
+ 'guictrlsetstate', 'guictrlsetstyle', 'guictrlsettip', 'guidelete',
+ 'guigetcursorinfo', 'guigetmsg', 'guiregistermsg', 'guisetbkcolor',
+ 'guisetcoord', 'guisetcursor', 'guisetfont', 'guisethelp',
+ 'guiseticon', 'guisetonevent', 'guisetstate', 'guistartgroup',
+ 'guiswitch', 'hex', 'hotkeyset', 'httpsetproxy', 'hwnd', 'inetget',
+ 'inetgetsize', 'inidelete', 'iniread', 'inireadsection',
+ 'inireadsectionnames', 'inirenamesection', 'iniwrite',
+ 'iniwritesection', 'inputbox', 'int', 'isadmin', 'isarray',
+ 'isbinarystring', 'isbool', 'isdeclared', 'isdllstruct', 'isfloat',
+ 'ishwnd', 'isint', 'iskeyword', 'isnumber', 'isobj', 'isstring',
+ 'log', 'memgetstats', 'mod', 'mouseclick', 'mouseclickdrag',
+ 'mousedown', 'mousegetcursor', 'mousegetpos', 'mousemove',
+ 'mouseup', 'mousewheel', 'msgbox', 'number', 'objcreate',
+ 'objevent', 'objget', 'objname', 'opt', 'ping', 'pixelchecksum',
+ 'pixelgetcolor', 'pixelsearch', 'pluginclose', 'pluginopen',
+ 'processclose', 'processexists', 'processlist',
+ 'processsetpriority', 'processwait', 'processwaitclose',
+ 'progressoff', 'progresson', 'progressset', 'random', 'regdelete',
+ 'regenumkey', 'regenumval', 'regread', 'regwrite', 'round', 'run',
+ 'runasset', 'runwait', 'send', 'seterror', 'setextended',
+ 'shellexecute', 'shellexecutewait', 'shutdown', 'sin', 'sleep',
+ 'soundplay', 'soundsetwavevolume', 'splashimageon', 'splashoff',
+ 'splashtexton', 'sqrt', 'srandom', 'statusbargettext',
+ 'stderrread', 'stdinwrite', 'stdoutread', 'string', 'stringaddcr',
+ 'stringformat', 'stringinstr', 'stringisalnum', 'stringisalpha',
+ 'stringisascii', 'stringisdigit', 'stringisfloat', 'stringisint',
+ 'stringislower', 'stringisspace', 'stringisupper',
+ 'stringisxdigit', 'stringleft', 'stringlen', 'stringlower',
+ 'stringmid', 'stringregexp', 'stringregexpreplace',
+ 'stringreplace', 'stringright', 'stringsplit', 'stringstripcr',
+ 'stringstripws', 'stringtrimleft', 'stringtrimright',
+ 'stringupper', 'tan', 'tcpaccept', 'tcpclosesocket', 'tcpconnect',
+ 'tcplisten', 'tcpnametoip', 'tcprecv', 'tcpsend', 'tcpshutdown',
+ 'tcpstartup', 'timerdiff', 'timerinit', 'timerstart', 'timerstop',
+ 'tooltip', 'traycreateitem', 'traycreatemenu', 'traygetmsg',
+ 'trayitemdelete', 'trayitemgethandle', 'trayitemgetstate',
+ 'trayitemgettext', 'trayitemsetonevent', 'trayitemsetstate',
+ 'trayitemsettext', 'traysetclick', 'trayseticon', 'traysetonevent',
+ 'traysetpauseicon', 'traysetstate', 'traysettooltip', 'traytip',
+ 'ubound', 'udpbind', 'udpclosesocket', 'udpopen', 'udprecv',
+ 'udpsend', 'winactivate', 'winactive', 'winclose', 'winexists',
+ 'winflash', 'wingetcaretpos', 'wingetclasslist',
+ 'wingetclientsize', 'wingethandle', 'wingetpos', 'wingetprocess',
+ 'wingetstate', 'wingettext', 'wingettitle', 'winkill', 'winlist',
+ 'winmenuselectitem', 'winminimizeall', 'winminimizeallundo',
+ 'winmove', 'winsetontop', 'winsetstate', 'winsettitle',
+ 'winsettrans', 'winshow', 'winwait', 'winwaitactive',
+ 'winwaitclose', 'winwaitnotactive'
+ ),
+ 4 => array(
+ '_arrayadd', '_arraybinarysearch', '_arraycreate', '_arraydelete',
+ '_arraydisplay', '_arrayinsert', '_arraymax', '_arraymaxindex',
+ '_arraymin', '_arrayminindex', '_arraypop', '_arraypush',
+ '_arrayreverse', '_arraysearch', '_arraysort', '_arrayswap',
+ '_arraytoclip', '_arraytostring', '_arraytrim', '_colorgetblue',
+ '_colorgetgreen', '_colorgetred', '_dateadd', '_datedayofweek',
+ '_datedaysinmonth', '_datediff', '_dateisleapyear', '_dateisvalid',
+ '_datetimeformat', '_datetimesplit', '_datetodayofweek',
+ '_datetodayofweekiso', '_datetodayvalue', '_dayvaluetodate',
+ '_now', '_nowcalc', '_nowcalcdate', '_nowdate', '_nowtime',
+ '_setdate', '_settime', '_tickstotime', '_timetoticks',
+ '_weeknumberiso', '_filecountlines', '_filecreate',
+ '_filelisttoarray', '_fileprint', '_filereadtoarray',
+ '_filewritefromarray', '_filewritelog', '_filewritetoline',
+ '_pathfull', '_pathmake', '_pathsplit', '_replacestringinfile',
+ '_tempfile', '_guictrlcomboadddir', '_guictrlcomboaddstring',
+ '_guictrlcomboautocomplete', '_guictrlcombodeletestring',
+ '_guictrlcombofindstring', '_guictrlcombogetcount',
+ '_guictrlcombogetcursel', '_guictrlcombogetdroppedcontrolrect',
+ '_guictrlcombogetdroppedstate', '_guictrlcombogetdroppedwidth',
+ '_guictrlcombogeteditsel', '_guictrlcombogetextendedui',
+ '_guictrlcombogethorizontalextent', '_guictrlcombogetitemheight',
+ '_guictrlcombogetlbtext', '_guictrlcombogetlbtextlen',
+ '_guictrlcombogetlist', '_guictrlcombogetlocale',
+ '_guictrlcombogetminvisible', '_guictrlcombogettopindex',
+ '_guictrlcomboinitstorage', '_guictrlcomboinsertstring',
+ '_guictrlcombolimittext', '_guictrlcomboresetcontent',
+ '_guictrlcomboselectstring', '_guictrlcombosetcursel',
+ '_guictrlcombosetdroppedwidth', '_guictrlcomboseteditsel',
+ '_guictrlcombosetextendedui', '_guictrlcombosethorizontalextent',
+ '_guictrlcombosetitemheight', '_guictrlcombosetminvisible',
+ '_guictrlcombosettopindex', '_guictrlcomboshowdropdown',
+ '_guictrleditcanundo', '_guictrleditemptyundobuffer',
+ '_guictrleditfind', '_guictrleditgetfirstvisibleline',
+ '_guictrleditgetline', '_guictrleditgetlinecount',
+ '_guictrleditgetmodify', '_guictrleditgetrect',
+ '_guictrleditgetsel', '_guictrleditlinefromchar',
+ '_guictrleditlineindex', '_guictrleditlinelength',
+ '_guictrleditlinescroll', '_guictrleditreplacesel',
+ '_guictrleditscroll', '_guictrleditsetmodify',
+ '_guictrleditsetrect', '_guictrleditsetsel', '_guictrleditundo',
+ '_guictrlipaddressclear', '_guictrlipaddresscreate',
+ '_guictrlipaddressdelete', '_guictrlipaddressget',
+ '_guictrlipaddressisblank', '_guictrlipaddressset',
+ '_guictrlipaddresssetfocus', '_guictrlipaddresssetfont',
+ '_guictrlipaddresssetrange', '_guictrlipaddressshowhide',
+ '_guictrllistadddir', '_guictrllistadditem', '_guictrllistclear',
+ '_guictrllistcount', '_guictrllistdeleteitem',
+ '_guictrllistfindstring', '_guictrllistgetanchorindex',
+ '_guictrllistgetcaretindex', '_guictrllistgethorizontalextent',
+ '_guictrllistgetinfo', '_guictrllistgetitemrect',
+ '_guictrllistgetlocale', '_guictrllistgetselcount',
+ '_guictrllistgetselitems', '_guictrllistgetselitemstext',
+ '_guictrllistgetselstate', '_guictrllistgettext',
+ '_guictrllistgettextlen', '_guictrllistgettopindex',
+ '_guictrllistinsertitem', '_guictrllistreplacestring',
+ '_guictrllistselectedindex', '_guictrllistselectindex',
+ '_guictrllistselectstring', '_guictrllistselitemrange',
+ '_guictrllistselitemrangeex', '_guictrllistsetanchorindex',
+ '_guictrllistsetcaretindex', '_guictrllistsethorizontalextent',
+ '_guictrllistsetlocale', '_guictrllistsetsel',
+ '_guictrllistsettopindex', '_guictrllistsort',
+ '_guictrllistswapstring', '_guictrllistviewcopyitems',
+ '_guictrllistviewdeleteallitems', '_guictrllistviewdeletecolumn',
+ '_guictrllistviewdeleteitem',
+ '_guictrllistviewdeleteitemsselected',
+ '_guictrllistviewensurevisible', '_guictrllistviewfinditem',
+ '_guictrllistviewgetbackcolor', '_guictrllistviewgetcallbackmask',
+ '_guictrllistviewgetcheckedstate',
+ '_guictrllistviewgetcolumnorder', '_guictrllistviewgetcolumnwidth',
+ '_guictrllistviewgetcounterpage', '_guictrllistviewgetcursel',
+ '_guictrllistviewgetextendedlistviewstyle',
+ '_guictrllistviewgetheader', '_guictrllistviewgethotcursor',
+ '_guictrllistviewgethotitem', '_guictrllistviewgethovertime',
+ '_guictrllistviewgetitemcount', '_guictrllistviewgetitemtext',
+ '_guictrllistviewgetitemtextarray', '_guictrllistviewgetnextitem',
+ '_guictrllistviewgetselectedcount',
+ '_guictrllistviewgetselectedindices',
+ '_guictrllistviewgetsubitemscount', '_guictrllistviewgettopindex',
+ '_guictrllistviewgetunicodeformat', '_guictrllistviewhidecolumn',
+ '_guictrllistviewinsertcolumn', '_guictrllistviewinsertitem',
+ '_guictrllistviewjustifycolumn', '_guictrllistviewscroll',
+ '_guictrllistviewsetcheckstate',
+ '_guictrllistviewsetcolumnheadertext',
+ '_guictrllistviewsetcolumnorder', '_guictrllistviewsetcolumnwidth',
+ '_guictrllistviewsethotitem', '_guictrllistviewsethovertime',
+ '_guictrllistviewsetitemcount', '_guictrllistviewsetitemselstate',
+ '_guictrllistviewsetitemtext', '_guictrllistviewsort',
+ '_guictrlmonthcalget1stdow', '_guictrlmonthcalgetcolor',
+ '_guictrlmonthcalgetdelta', '_guictrlmonthcalgetmaxselcount',
+ '_guictrlmonthcalgetmaxtodaywidth',
+ '_guictrlmonthcalgetminreqrect', '_guictrlmonthcalset1stdow',
+ '_guictrlmonthcalsetcolor', '_guictrlmonthcalsetdelta',
+ '_guictrlmonthcalsetmaxselcount', '_guictrlslidercleartics',
+ '_guictrlslidergetlinesize', '_guictrlslidergetnumtics',
+ '_guictrlslidergetpagesize', '_guictrlslidergetpos',
+ '_guictrlslidergetrangemax', '_guictrlslidergetrangemin',
+ '_guictrlslidersetlinesize', '_guictrlslidersetpagesize',
+ '_guictrlslidersetpos', '_guictrlslidersetticfreq',
+ '_guictrlstatusbarcreate', '_guictrlstatusbarcreateprogress',
+ '_guictrlstatusbardelete', '_guictrlstatusbargetborders',
+ '_guictrlstatusbargeticon', '_guictrlstatusbargetparts',
+ '_guictrlstatusbargetrect', '_guictrlstatusbargettext',
+ '_guictrlstatusbargettextlength', '_guictrlstatusbargettip',
+ '_guictrlstatusbargetunicode', '_guictrlstatusbarissimple',
+ '_guictrlstatusbarresize', '_guictrlstatusbarsetbkcolor',
+ '_guictrlstatusbarseticon', '_guictrlstatusbarsetminheight',
+ '_guictrlstatusbarsetparts', '_guictrlstatusbarsetsimple',
+ '_guictrlstatusbarsettext', '_guictrlstatusbarsettip',
+ '_guictrlstatusbarsetunicode', '_guictrlstatusbarshowhide',
+ '_guictrltabdeleteallitems', '_guictrltabdeleteitem',
+ '_guictrltabdeselectall', '_guictrltabgetcurfocus',
+ '_guictrltabgetcursel', '_guictrltabgetextendedstyle',
+ '_guictrltabgetitemcount', '_guictrltabgetitemrect',
+ '_guictrltabgetrowcount', '_guictrltabgetunicodeformat',
+ '_guictrltabhighlightitem', '_guictrltabsetcurfocus',
+ '_guictrltabsetcursel', '_guictrltabsetmintabwidth',
+ '_guictrltabsetunicodeformat', '_guictrltreeviewdeleteallitems',
+ '_guictrltreeviewdeleteitem', '_guictrltreeviewexpand',
+ '_guictrltreeviewgetbkcolor', '_guictrltreeviewgetcount',
+ '_guictrltreeviewgetindent', '_guictrltreeviewgetlinecolor',
+ '_guictrltreeviewgetparenthandle', '_guictrltreeviewgetparentid',
+ '_guictrltreeviewgetstate', '_guictrltreeviewgettext',
+ '_guictrltreeviewgettextcolor', '_guictrltreeviewgettree',
+ '_guictrltreeviewinsertitem', '_guictrltreeviewsetbkcolor',
+ '_guictrltreeviewseticon', '_guictrltreeviewsetindent',
+ '_guictrltreeviewsetlinecolor', '_guictrltreeviewsetstate',
+ '_guictrltreeviewsettext', '_guictrltreeviewsettextcolor',
+ '_guictrltreeviewsort', '_ie_example', '_ie_introduction',
+ '_ie_versioninfo', '_ieaction', '_ieattach', '_iebodyreadhtml',
+ '_iebodyreadtext', '_iebodywritehtml', '_iecreate',
+ '_iecreateembedded', '_iedocgetobj', '_iedocinserthtml',
+ '_iedocinserttext', '_iedocreadhtml', '_iedocwritehtml',
+ '_ieerrorhandlerderegister', '_ieerrorhandlerregister',
+ '_ieerrornotify', '_ieformelementcheckboxselect',
+ '_ieformelementgetcollection', '_ieformelementgetobjbyname',
+ '_ieformelementgetvalue', '_ieformelementoptionselect',
+ '_ieformelementradioselect', '_ieformelementsetvalue',
+ '_ieformgetcollection', '_ieformgetobjbyname', '_ieformimageclick',
+ '_ieformreset', '_ieformsubmit', '_ieframegetcollection',
+ '_ieframegetobjbyname', '_iegetobjbyname',
+ '_ieheadinserteventscript', '_ieimgclick', '_ieimggetcollection',
+ '_ieisframeset', '_ielinkclickbyindex', '_ielinkclickbytext',
+ '_ielinkgetcollection', '_ieloadwait', '_ieloadwaittimeout',
+ '_ienavigate', '_iepropertyget', '_iepropertyset', '_iequit',
+ '_ietablegetcollection', '_ietablewritetoarray',
+ '_ietagnameallgetcollection', '_ietagnamegetcollection', '_getip',
+ '_inetexplorercapable', '_inetgetsource', '_inetmail',
+ '_inetsmtpmail', '_tcpiptoname', '_degree', '_mathcheckdiv',
+ '_max', '_min', '_radian', '_choosecolor', '_choosefont',
+ '_clipputfile', '_iif', '_ispressed', '_mousetrap', '_singleton',
+ '_processgetname', '_processgetpriority', '_rundos',
+ '_sendmessage', '_soundclose', '_soundlength', '_soundopen',
+ '_soundpause', '_soundplay', '_soundpos', '_soundresume',
+ '_soundseek', '_soundstatus', '_soundstop', '_sqlite_changes',
+ '_sqlite_close', '_sqlite_display2dresult', '_sqlite_encode',
+ '_sqlite_errcode', '_sqlite_errmsg', '_sqlite_escape',
+ '_sqlite_exec', '_sqlite_fetchdata', '_sqlite_fetchnames',
+ '_sqlite_gettable', '_sqlite_gettable2d',
+ '_sqlite_lastinsertrowid', '_sqlite_libversion', '_sqlite_open',
+ '_sqlite_query', '_sqlite_queryfinalize', '_sqlite_queryreset',
+ '_sqlite_querysinglerow', '_sqlite_savemode', '_sqlite_settimeout',
+ '_sqlite_shutdown', '_sqlite_sqliteexe', '_sqlite_startup',
+ '_sqlite_totalchanges', '_hextostring', '_stringaddcomma',
+ '_stringbetween', '_stringencrypt', '_stringinsert',
+ '_stringproper', '_stringrepeat', '_stringreverse', '_stringtohex',
+ '_viclose', '_viexeccommand', '_vifindgpib', '_vigpibbusreset',
+ '_vigtl', '_viopen', '_visetattribute', '_visettimeout'
+ ),
+ 5 => array(
+ '#include', '#include-once', '#notrayicon'
+ ),
+ 6 => array(
+ '#forceref', '#compiler_allow_decompile', '#compiler_au3check_dat',
+ '#compiler_au3check_parameters',
+ '#compiler_au3check_stop_onwarning', '#compiler_aut2exe',
+ '#compiler_autoit3', '#compiler_compression', '#compiler_icon',
+ '#compiler_outfile', '#compiler_outfile_type',
+ '#compiler_passphrase', '#compiler_plugin_funcs',
+ '#compiler_prompt', '#compiler_res_comment',
+ '#compiler_res_description', '#compiler_res_field',
+ '#compiler_res_field1name', '#compiler_res_field1value',
+ '#compiler_res_field2name', '#compiler_res_field2value',
+ '#compiler_res_fileversion',
+ '#compiler_res_fileversion_autoincrement',
+ '#compiler_res_legalcopyright', '#compiler_run_after',
+ '#compiler_run_au3check', '#compiler_run_before',
+ '#compiler_run_cvswrapper', '#compiler_run_tidy',
+ '#compiler_tidy_stop_onerror', '#compiler_useupx', '#endregion',
+ '#region', '#run_debug_mode', '#tidy_parameters'
+ )
),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '&', '*', '/', '<', '>', '+', '-', '^', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF; font-weight: bold;',
- 2 => 'color: #FF33FF; font-weight: bold;',
- 3 => 'color: #000090; font-style: italic; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 0 => 'font-style: italic; color: #669900;', 'MULTI' => 'font-style: italic; color: #669900;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #FF0000; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'font-weight: bold; color: #9999CC;'
- ),
- 'NUMBERS' => array(
- 0 => 'font-style: italic; font-weight: bold; color: #AC00A9;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #FF0000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'font-weight: bold; color: #AA0000;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.autoitscript.com/autoit3/docs/keywords.htm',
- 2 => 'http://www.autoitscript.com/autoit3/docs/macros.htm',
- 3 => 'http://www.autoitscript.com/autoit3/docs/functions/{FNAME}.htm',
- 4 => ''
- ),
-
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*",
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
-/* 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<?php' => '?>'
- ),
- 1 => array(
- '<?' => '?>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- 3 => array(
- '<script language="php">' => '</script>'
- )
- ),*/
-
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- )
+ 'SYMBOLS' => array(
+ '(', ')', '[', ']', '&', '*', '/', '<', '>', '+', '-', '^', '=', '.'
+ ),
+ 'CASE_SENSITIVE' => array(
+ GESHI_COMMENTS => false,
+ 1 => false,
+ 2 => false,
+ 3 => false,
+ 4 => false,
+ 5 => false,
+ 6 => false
+ ),
+ 'STYLES' => array(
+ 'KEYWORDS' => array(
+ 1 => 'color: #0000FF; font-weight: bold;',
+ 2 => 'color: #800000; font-weight: bold;',
+ 3 => 'color: #000080; font-style: italic; font-weight: bold;',
+ 4 => 'color: #0080FF; font-style: italic; font-weight: bold;',
+ 5 => 'color: #F000FF; font-style: italic;',
+ 6 => 'color: #A00FF0; font-style: italic;'
+ ),
+ 'COMMENTS' => array(
+ 0 => 'font-style: italic; color: #009933;',
+ 'MULTI' => 'font-style: italic; color: #669900;'
+ ),
+ 'ESCAPE_CHAR' => array(
+ 0 => ''
+ ),
+ 'BRACKETS' => array(
+ 0 => 'color: #FF0000; font-weight: bold;'
+ ),
+ 'STRINGS' => array(
+ 0 => 'font-weight: bold; color: #008080;'
+ ),
+ 'NUMBERS' => array(
+ 0 => 'color: #AC00A9; font-style: italic; font-weight: bold;'
+ ),
+ 'METHODS' => array(
+ 1 => 'color: #0000FF; font-style: italic; font-weight: bold;'
+ ),
+ 'SYMBOLS' => array(
+ 0 => 'color: #FF0000; font-weight: bold;'
+ ),
+ 'REGEXPS' => array(
+ 0 => 'font-weight: bold; color: #AA0000;'
+ ),
+ 'SCRIPT' => array(
+ 0 => '',
+ 1 => '',
+ 2 => '',
+ 3 => '',
+ 4 => '',
+ 5 => '',
+ 6 => ''
+ )
+ ),
+ 'URLS' => array(
+ 1 => 'http://www.autoitscript.com/autoit3/docs/keywords.htm',
+ 2 => 'http://www.autoitscript.com/autoit3/docs/macros.htm',
+ 3 => 'http://www.autoitscript.com/autoit3/docs/functions/{FNAME}.htm',
+ 4 => ''
+ ),
+ 'OOLANG' => true,
+ 'OBJECT_SPLITTERS' => array(
+ 1 => '.'
+ ),
+ 'REGEXPS' => array(
+ 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*'
+ ),
+ 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
+ 'SCRIPT_DELIMITERS' => array(
+ ),
+ 'HIGHLIGHT_STRICT_BLOCK' => array(
+ 0 => true,
+ 1 => true,
+ 2 => true,
+ 3 => true
+ )
);
?>
diff --git a/inc/geshi/bash.php b/inc/geshi/bash.php
index dad5a5d43..ab9f9f4b1 100644
--- a/inc/geshi/bash.php
+++ b/inc/geshi/bash.php
@@ -4,10 +4,8 @@
* --------
* Author: Andreas Gohr (andi@splitbrain.org)
* Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* BASH language file for GeSHi.
*
diff --git a/inc/geshi/blitzbasic.php b/inc/geshi/blitzbasic.php
index bdb97aa38..40b27a537 100644
--- a/inc/geshi/blitzbasic.php
+++ b/inc/geshi/blitzbasic.php
@@ -4,10 +4,8 @@
* --------------
* Author: P�draig O`Connel (info@moonsword.info)
* Copyright: (c) 2005 P�draig O`Connel (http://moonsword.info)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 16.10.2005
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* BlitzBasic language file for GeSHi.
*
@@ -184,4 +182,4 @@
)
);
-?> \ No newline at end of file
+?>
diff --git a/inc/geshi/bnf.php b/inc/geshi/bnf.php
index 50c95ed52..0f426e003 100644
--- a/inc/geshi/bnf.php
+++ b/inc/geshi/bnf.php
@@ -4,10 +4,8 @@
* --------
* Author: Rowan Rodrik van der Molen (rowan@bigsmoke.us)
* Copyright: (c) 2006 Rowan Rodrik van der Molen (http://www.bigsmoke.us/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/09/28
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* BNF (Backus-Naur form) language file for GeSHi.
*
diff --git a/inc/geshi/c.php b/inc/geshi/c.php
index f1c0e9fab..cfa3e8925 100644
--- a/inc/geshi/c.php
+++ b/inc/geshi/c.php
@@ -6,10 +6,8 @@
* Contributors:
* - Jack Lloyd (lloyd@randombit.net)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* C language file for GeSHi.
*
diff --git a/inc/geshi/c_mac.php b/inc/geshi/c_mac.php
index 12aa655e4..e5ef0fbf2 100644
--- a/inc/geshi/c_mac.php
+++ b/inc/geshi/c_mac.php
@@ -4,10 +4,8 @@
* ---------
* Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
* Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* C for Macs language file for GeSHi.
*
diff --git a/inc/geshi/caddcl.php b/inc/geshi/caddcl.php
index 89c723d8a..25d471c86 100644
--- a/inc/geshi/caddcl.php
+++ b/inc/geshi/caddcl.php
@@ -4,10 +4,8 @@
* ----------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* CAD DCL (Dialog Control Language) file for GeSHi.
*
diff --git a/inc/geshi/cadlisp.php b/inc/geshi/cadlisp.php
index d11e5e66b..f5dd1272f 100644
--- a/inc/geshi/cadlisp.php
+++ b/inc/geshi/cadlisp.php
@@ -4,10 +4,8 @@
* -----------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/blog)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* AutoCAD/IntelliCAD Lisp language file for GeSHi.
*
diff --git a/inc/geshi/cfdg.php b/inc/geshi/cfdg.php
index 39910a599..78585f118 100644
--- a/inc/geshi/cfdg.php
+++ b/inc/geshi/cfdg.php
@@ -4,10 +4,8 @@
* --------
* Author: John Horigan <john@glyphic.com>
* Copyright: (c) 2006 John Horigan http://www.ozonehouse.com/john/
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/03/11
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* CFDG language file for GeSHi.
*
diff --git a/inc/geshi/cfm.php b/inc/geshi/cfm.php
index 723840a62..f14bf5280 100644
--- a/inc/geshi/cfm.php
+++ b/inc/geshi/cfm.php
@@ -4,10 +4,8 @@
* -------
* Author: Diego ()
* Copyright: (c) 2006 Diego
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 880 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/02/25
- * Last Modified: $Date: 2007-01-07 23:27:06 +1300 (Sun, 07 Jan 2007) $
*
* ColdFusion language file for GeSHi.
*
diff --git a/inc/geshi/cpp-qt.php b/inc/geshi/cpp-qt.php
index b71628da1..4ab8072c4 100644
--- a/inc/geshi/cpp-qt.php
+++ b/inc/geshi/cpp-qt.php
@@ -4,10 +4,8 @@
* -------
* Author: Iulian M
* Copyright: (c) 2006 Iulian M
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/09/27
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* C++ language file for GeSHi, with QT extensions.
*
diff --git a/inc/geshi/cpp.php b/inc/geshi/cpp.php
index 3f14becef..096dc696b 100644
--- a/inc/geshi/cpp.php
+++ b/inc/geshi/cpp.php
@@ -7,10 +7,8 @@
* - 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.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/09/27
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* C++ language file for GeSHi.
*
diff --git a/inc/geshi/csharp.php b/inc/geshi/csharp.php
index 2251da62a..83683425a 100644
--- a/inc/geshi/csharp.php
+++ b/inc/geshi/csharp.php
@@ -4,10 +4,8 @@
* ----------
* Author: Alan Juden (alan@judenware.org)
* Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* C# language file for GeSHi.
*
diff --git a/inc/geshi/css.php b/inc/geshi/css.php
index a91ad5030..1d7c0a6ae 100644
--- a/inc/geshi/css.php
+++ b/inc/geshi/css.php
@@ -4,10 +4,8 @@
* -------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 883 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/18
- * Last Modified: $Date: 2007-01-13 17:41:38 +1300 (Sat, 13 Jan 2007) $
*
* CSS language file for GeSHi.
*
diff --git a/inc/geshi/d.php b/inc/geshi/d.php
index 68e17d0d2..507c7cb05 100644
--- a/inc/geshi/d.php
+++ b/inc/geshi/d.php
@@ -4,10 +4,8 @@
* -----
* Author: Thomas Kuehne (thomas@kuehne.cn)
* Copyright: (c) 2005 Thomas Kuehne (http://thomas.kuehne.cn/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/04/22
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* D language file for GeSHi.
*
diff --git a/inc/geshi/delphi.php b/inc/geshi/delphi.php
index 06e5c17ed..1b2f53229 100644
--- a/inc/geshi/delphi.php
+++ b/inc/geshi/delphi.php
@@ -4,10 +4,8 @@
* ----------
* Author: Járja Norbert (jnorbi@vipmail.hu)
* Copyright: (c) 2004 Járja Norbert, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/26
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Delphi (Object Pascal) language file for GeSHi.
*
diff --git a/inc/geshi/diff.php b/inc/geshi/diff.php
index 640bd24ac..ad3ac0e0d 100644
--- a/inc/geshi/diff.php
+++ b/inc/geshi/diff.php
@@ -4,10 +4,8 @@
* --------
* Author: Conny Brunnkvist (conny@fuchsia.se), W. Tasin (tasin@fhm.edu)
* Copyright: (c) 2004 Fuchsia Open Source Solutions (http://www.fuchsia.se/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/12/29
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Diff-output language file for GeSHi.
*
diff --git a/inc/geshi/div.php b/inc/geshi/div.php
index 6d938849d..1348984f4 100644
--- a/inc/geshi/div.php
+++ b/inc/geshi/div.php
@@ -4,10 +4,8 @@
* ---------------------------------
* Author: Gabriel Lorenzo (ermakina@gmail.com)
* Copyright: (c) 2005 Gabriel Lorenzo (http://ermakina.gazpachito.net)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/06/19
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* DIV language file for GeSHi.
*
diff --git a/inc/geshi/dos.php b/inc/geshi/dos.php
index 57e1ee4fb..926f7496e 100644
--- a/inc/geshi/dos.php
+++ b/inc/geshi/dos.php
@@ -4,10 +4,8 @@
* -------
* Author: Alessandro Staltari (staltari@geocities.com)
* Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/07/05
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* DOS language file for GeSHi.
*
diff --git a/inc/geshi/eiffel.php b/inc/geshi/eiffel.php
index 798085822..ce8c7b190 100644
--- a/inc/geshi/eiffel.php
+++ b/inc/geshi/eiffel.php
@@ -4,10 +4,8 @@
* ----------
* Author: Zoran Simic (zsimic@axarosenberg.com)
* Copyright: (c) 2005 Zoran Simic
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/06/30
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* Eiffel language file for GeSHi.
*
diff --git a/inc/geshi/fortran.php b/inc/geshi/fortran.php
index 607402b85..8ffe39fad 100644
--- a/inc/geshi/fortran.php
+++ b/inc/geshi/fortran.php
@@ -4,10 +4,8 @@
* -----------
* Author: Cedric Arrabie (cedric.arrabie@univ-pau.fr)
* Copyright: (C) 2006 Cetric Arrabie
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/04/22
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Fortran language file for GeSHi.
*
diff --git a/inc/geshi/freebasic.php b/inc/geshi/freebasic.php
index 87079f5c8..cfc2731ae 100644
--- a/inc/geshi/freebasic.php
+++ b/inc/geshi/freebasic.php
@@ -4,7 +4,7 @@
* -------------
* Author: Roberto Rossi
* Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.7.17
+ * Release Version: 1.0.7.18
* Date Started: 2005/08/19
*
* FreeBasic (http://www.freebasic.net/) language file for GeSHi.
diff --git a/inc/geshi/gml.php b/inc/geshi/gml.php
index 21e47689e..22adb91af 100644
--- a/inc/geshi/gml.php
+++ b/inc/geshi/gml.php
@@ -4,10 +4,8 @@
* --------
* Author: José Jorge Enríquez (jenriquez@users.sourceforge.net)
* Copyright: (c) 2005 José Jorge Enríquez Rodríguez (http://www.zonamakers.com)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/06/21
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* GML language file for GeSHi.
*
diff --git a/inc/geshi/groovy.php b/inc/geshi/groovy.php
index 5a6491e54..1ee7234f6 100644
--- a/inc/geshi/groovy.php
+++ b/inc/geshi/groovy.php
@@ -4,10 +4,8 @@
* ----------
* Author: Ivan F. Villanueva B. (geshi_groovy@artificialidea.com)
* Copyright: (c) 2006 Ivan F. Villanueva B.(http://www.artificialidea.com)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/04/29
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Groovy language file for GeSHi.
*
diff --git a/inc/geshi/html4strict.php b/inc/geshi/html4strict.php
index 60ad76968..2ad7f4dec 100644
--- a/inc/geshi/html4strict.php
+++ b/inc/geshi/html4strict.php
@@ -4,10 +4,8 @@
* ---------------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/10
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* HTML 4.01 strict language file for GeSHi.
*
diff --git a/inc/geshi/idl.php b/inc/geshi/idl.php
index 0ec242624..1163fe939 100644
--- a/inc/geshi/idl.php
+++ b/inc/geshi/idl.php
@@ -4,10 +4,8 @@
* -------
* Author: Cedric Bosdonnat (cedricbosdo@openoffice.org)
* Copyright: (c) 2006 Cedric Bosdonnat
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/08/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Unoidl language file for GeSHi.
*
diff --git a/inc/geshi/ini.php b/inc/geshi/ini.php
index bf6515baa..37c832ca1 100644
--- a/inc/geshi/ini.php
+++ b/inc/geshi/ini.php
@@ -4,10 +4,8 @@
* --------
* Author: deguix (cevo_deguix@yahoo.com.br)
* Copyright: (c) 2005 deguix
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/03/27
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* INI language file for GeSHi.
*
diff --git a/inc/geshi/inno.php b/inc/geshi/inno.php
index a63debf58..80a09617b 100644
--- a/inc/geshi/inno.php
+++ b/inc/geshi/inno.php
@@ -4,10 +4,8 @@
* ----------
* Author: Thomas Klingler (hotline@theratech.de) based on delphi.php from Járja Norbert (jnorbi@vipmail.hu)
* Copyright: (c) 2004 Járja Norbert, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/07/29
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Inno Script language inkl. Delphi (Object Pascal) language file for GeSHi.
*
diff --git a/inc/geshi/io.php b/inc/geshi/io.php
index 940884d12..b998e0eb7 100644
--- a/inc/geshi/io.php
+++ b/inc/geshi/io.php
@@ -4,10 +4,8 @@
* -------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2006 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/09/23
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Io language file for GeSHi. Thanks to Johnathan Wright for the suggestion and help
* with this language :)
diff --git a/inc/geshi/java.php b/inc/geshi/java.php
index 573856ff4..e0f72fdf3 100644
--- a/inc/geshi/java.php
+++ b/inc/geshi/java.php
@@ -4,10 +4,8 @@
* --------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/10
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Java language file for GeSHi.
*
diff --git a/inc/geshi/java5.php b/inc/geshi/java5.php
index 4dbfadc73..2b16ff779 100644
--- a/inc/geshi/java5.php
+++ b/inc/geshi/java5.php
@@ -4,10 +4,8 @@
* --------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/10
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Java language file for GeSHi.
*
diff --git a/inc/geshi/javascript.php b/inc/geshi/javascript.php
index bec92f9a1..fce379e84 100644
--- a/inc/geshi/javascript.php
+++ b/inc/geshi/javascript.php
@@ -4,10 +4,8 @@
* --------------
* Author: Ben Keen (ben.keen@gmail.com)
* Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/20
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* JavaScript language file for GeSHi.
*
diff --git a/inc/geshi/lisp.php b/inc/geshi/lisp.php
index c5cbbaaee..dea130241 100644
--- a/inc/geshi/lisp.php
+++ b/inc/geshi/lisp.php
@@ -4,10 +4,8 @@
* --------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* Generic Lisp language file for GeSHi.
*
diff --git a/inc/geshi/lua.php b/inc/geshi/lua.php
index fd6d28a22..570df2900 100644
--- a/inc/geshi/lua.php
+++ b/inc/geshi/lua.php
@@ -4,10 +4,8 @@
* -------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/10
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* LUA language file for GeSHi.
*
diff --git a/inc/geshi/matlab.php b/inc/geshi/matlab.php
index 57ecfb2c5..cf3c73c31 100644
--- a/inc/geshi/matlab.php
+++ b/inc/geshi/matlab.php
@@ -4,10 +4,8 @@
* -----------
* Author: Florian Knorn (floz@gmx.de)
* Copyright: (c) 2004 Florian Knorn (http://www.florian-knorn.com)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/02/09
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Matlab M-file language file for GeSHi.
*
diff --git a/inc/geshi/mirc.php b/inc/geshi/mirc.php
index eab2ece24..084bd0132 100644
--- a/inc/geshi/mirc.php
+++ b/inc/geshi/mirc.php
@@ -4,10 +4,8 @@
* -----
* Author: Alberto 'Birckin' de Areba (Birckin@hotmail.com)
* Copyright: (c) 2006 Alberto de Areba
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/05/29
- * Last Modified: $LastChangedDate: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* mIRC Scripting language file for GeSHi.
*
diff --git a/inc/geshi/mpasm.php b/inc/geshi/mpasm.php
index 651985452..873196133 100644
--- a/inc/geshi/mpasm.php
+++ b/inc/geshi/mpasm.php
@@ -4,10 +4,8 @@
* ---------
* Author: Bakalex (bakalex@gmail.com)
* Copyright: (c) 2004 Bakalex, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/12/6
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Microchip Assembler language file for GeSHi.
*
diff --git a/inc/geshi/mysql.php b/inc/geshi/mysql.php
index 920401ad1..509cfd4d5 100644
--- a/inc/geshi/mysql.php
+++ b/inc/geshi/mysql.php
@@ -4,10 +4,8 @@
* ---------
* Author: Carl F�rstenberg (azatoth@gmail.com)
* Copyright: (c) 2005 Carl F�rstenberg, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* MySQL language file for GeSHi.
*
diff --git a/inc/geshi/nsis.php b/inc/geshi/nsis.php
index e656fa117..e630c6465 100644
--- a/inc/geshi/nsis.php
+++ b/inc/geshi/nsis.php
@@ -4,10 +4,8 @@
* --------
* Author: deguix (cevo_deguix@yahoo.com.br), Tux (http://tux.a4.cz/)
* Copyright: (c) 2005 deguix, 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/12/03
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Nullsoft Scriptable Install System language file for GeSHi.
*
diff --git a/inc/geshi/objc.php b/inc/geshi/objc.php
index 38d219d5c..6ebe0f4eb 100644
--- a/inc/geshi/objc.php
+++ b/inc/geshi/objc.php
@@ -4,10 +4,8 @@
* --------
* Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
* Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* Objective C language file for GeSHi.
*
diff --git a/inc/geshi/ocaml-brief.php b/inc/geshi/ocaml-brief.php
index f953188e8..388b31d36 100644
--- a/inc/geshi/ocaml-brief.php
+++ b/inc/geshi/ocaml-brief.php
@@ -4,10 +4,8 @@
* ----------
* Author: Flaie (fireflaie@gmail.com)
* Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/08/27
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* OCaml (Objective Caml) language file for GeSHi.
*
diff --git a/inc/geshi/ocaml.php b/inc/geshi/ocaml.php
index 88c619e53..73e28210b 100644
--- a/inc/geshi/ocaml.php
+++ b/inc/geshi/ocaml.php
@@ -4,10 +4,8 @@
* ----------
* Author: Flaie (fireflaie@gmail.com)
* Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/08/27
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* OCaml (Objective Caml) language file for GeSHi.
*
diff --git a/inc/geshi/oobas.php b/inc/geshi/oobas.php
index 16189a2b0..fadd4c1bf 100644
--- a/inc/geshi/oobas.php
+++ b/inc/geshi/oobas.php
@@ -4,10 +4,8 @@
* ---------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* OpenOffice.org Basic language file for GeSHi.
*
diff --git a/inc/geshi/oracle8.php b/inc/geshi/oracle8.php
index cacae95d6..b69116395 100644
--- a/inc/geshi/oracle8.php
+++ b/inc/geshi/oracle8.php
@@ -4,10 +4,8 @@
* -----------
* Author: Guy Wicks (Guy.Wicks@rbs.co.uk)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Oracle 8 language file for GeSHi
*
diff --git a/inc/geshi/pascal.php b/inc/geshi/pascal.php
index b0d2340ef..1836a88f7 100644
--- a/inc/geshi/pascal.php
+++ b/inc/geshi/pascal.php
@@ -4,10 +4,8 @@
* ----------
* Author: Tux (tux@inamil.cz)
* Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/26
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Pascal language file for GeSHi.
*
diff --git a/inc/geshi/perl.php b/inc/geshi/perl.php
index fffca6a26..b075ab134 100644
--- a/inc/geshi/perl.php
+++ b/inc/geshi/perl.php
@@ -4,10 +4,8 @@
* --------
* Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
* Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Perl language file for GeSHi.
*
diff --git a/inc/geshi/php-brief.php b/inc/geshi/php-brief.php
index 02f0e870b..44af932a7 100644
--- a/inc/geshi/php-brief.php
+++ b/inc/geshi/php-brief.php
@@ -4,10 +4,8 @@
* -------------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/02
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* PHP language file for GeSHi (brief version).
*
diff --git a/inc/geshi/php.php b/inc/geshi/php.php
index d38ccbc0e..60a46a9ec 100644
--- a/inc/geshi/php.php
+++ b/inc/geshi/php.php
@@ -4,10 +4,8 @@
* --------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* PHP language file for GeSHi.
*
diff --git a/inc/geshi/plsql.php b/inc/geshi/plsql.php
index 242181bff..0b4f0508d 100644
--- a/inc/geshi/plsql.php
+++ b/inc/geshi/plsql.php
@@ -4,10 +4,8 @@
* -------
* Author: Victor Engmark <victor.engmark@gmail.com>
* Copyright: (c) 2006 Victor Engmark (http://l0b0.net/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/10/26
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Oracle 9.2 PL/SQL language file for GeSHi.
* Formatting is based on the default setup of TOAD 8.6.
diff --git a/inc/geshi/python.php b/inc/geshi/python.php
index 5ccf59fb3..497287fe3 100644
--- a/inc/geshi/python.php
+++ b/inc/geshi/python.php
@@ -4,10 +4,8 @@
* ----------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Python language file for GeSHi.
*
@@ -138,7 +136,7 @@ $language_data = array (
'__iter__', 'next',
// String types: http://python.org/doc/current/lib/string-methods.html
'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
- 'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
+ 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle',
'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill',
diff --git a/inc/geshi/qbasic.php b/inc/geshi/qbasic.php
index 2298ba867..41bd04caf 100644
--- a/inc/geshi/qbasic.php
+++ b/inc/geshi/qbasic.php
@@ -4,10 +4,8 @@
* ----------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/20
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* QBasic/QuickBASIC language file for GeSHi.
*
diff --git a/inc/geshi/reg.php b/inc/geshi/reg.php
index a895e5cf0..f89efa4f6 100644
--- a/inc/geshi/reg.php
+++ b/inc/geshi/reg.php
@@ -4,10 +4,8 @@
* -------
* Author: Sean Hanna (smokingrope@gmail.com)
* Copyright: (c) 2006 Sean Hanna
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 03/15/2006
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Microsoft Registry Editor Language File.
*
diff --git a/inc/geshi/robots.php b/inc/geshi/robots.php
index f771233ef..f5ad0159b 100644
--- a/inc/geshi/robots.php
+++ b/inc/geshi/robots.php
@@ -4,10 +4,8 @@
* --------
* Author: Christian Lescuyer (cl@goelette.net)
* Copyright: (c) 2006 Christian Lescuyer http://xtian.goelette.info
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/02/17
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* robots.txt language file for GeSHi.
*
@@ -97,4 +95,4 @@ $language_data = array (
)
);
-?> \ No newline at end of file
+?>
diff --git a/inc/geshi/ruby.php b/inc/geshi/ruby.php
index f58d13d76..b9b4b7454 100644
--- a/inc/geshi/ruby.php
+++ b/inc/geshi/ruby.php
@@ -4,10 +4,8 @@
* --------
* Author: Amit Gupta (http://blog.igeek.info/)
* Copyright: (c) 2005 Amit Gupta (http://blog.igeek.info/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/09/05
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Ruby language file for GeSHi
*
diff --git a/inc/geshi/sas.php b/inc/geshi/sas.php
index eb1dddd0f..65ee68fef 100644
--- a/inc/geshi/sas.php
+++ b/inc/geshi/sas.php
@@ -4,10 +4,8 @@
* -------
* Author: Galen Johnson (solitaryr@gmail.com)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/12/27
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* SAS language file for GeSHi. Based on the sas vim file.
*
diff --git a/inc/geshi/scheme.php b/inc/geshi/scheme.php
index 3c12aebc5..05a152b7f 100644
--- a/inc/geshi/scheme.php
+++ b/inc/geshi/scheme.php
@@ -4,10 +4,8 @@
* ----------
* Author: Jon Raphaelson (jonraphaelson@gmail.com)
* Copyright: (c) 2005 Jon Raphaelson, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Scheme language file for GeSHi.
*
diff --git a/inc/geshi/sdlbasic.php b/inc/geshi/sdlbasic.php
index 28f863591..00e7685a3 100644
--- a/inc/geshi/sdlbasic.php
+++ b/inc/geshi/sdlbasic.php
@@ -4,10 +4,8 @@
* ------------
* Author: Roberto Rossi
* Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/08/19
- * Date Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* sdlBasic (http://sdlbasic.sf.net) language file for GeSHi.
*
diff --git a/inc/geshi/smalltalk.php b/inc/geshi/smalltalk.php
index 2f548c18d..66df62da8 100644
--- a/inc/geshi/smalltalk.php
+++ b/inc/geshi/smalltalk.php
@@ -4,10 +4,8 @@
* --------
* Author: Bananeweizen (Bananeweizen@gmx.de)
* Copyright: (c) 2005 Bananeweizen (www.bananeweizen.de)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/03/27
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* Smalltalk language file for GeSHi.
*
diff --git a/inc/geshi/smarty.php b/inc/geshi/smarty.php
index 5dff9772a..8919b9c4d 100644
--- a/inc/geshi/smarty.php
+++ b/inc/geshi/smarty.php
@@ -4,10 +4,8 @@
* ----------
* Author: Alan Juden (alan@judenware.org)
* Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/07/10
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Smarty template language file for GeSHi.
*
diff --git a/inc/geshi/sql.php b/inc/geshi/sql.php
index d07aaa082..32dc561c7 100644
--- a/inc/geshi/sql.php
+++ b/inc/geshi/sql.php
@@ -4,10 +4,8 @@
* -------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* SQL language file for GeSHi.
*
diff --git a/inc/geshi/tcl.php b/inc/geshi/tcl.php
index c13891ad3..9ea71996c 100644
--- a/inc/geshi/tcl.php
+++ b/inc/geshi/tcl.php
@@ -4,10 +4,8 @@
* ---------------------------------
* Author: Reid van Melle (rvanmelle@gmail.com)
* Copyright: (c) 2004 Reid van Melle (sorry@nowhere)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/05/05
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* TCL/iTCL language file for GeSHi.
*
diff --git a/inc/geshi/text.php b/inc/geshi/text.php
index 50cfda881..2a45ee433 100644
--- a/inc/geshi/text.php
+++ b/inc/geshi/text.php
@@ -4,10 +4,8 @@
* --------
* Author: Sean Hanna (smokingrope@gmail.com)
* Copyright: (c) 2006 Sean Hanna
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 04/23/2006
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* Standard Text File (No Syntax Highlighting).
*
diff --git a/inc/geshi/thinbasic.php b/inc/geshi/thinbasic.php
index 035e2b7c3..3f533b1e7 100644
--- a/inc/geshi/thinbasic.php
+++ b/inc/geshi/thinbasic.php
@@ -4,10 +4,8 @@
* ------
* Author: Eros Olmi (eros.olmi@thinbasic.com)
* Copyright: (c) 2006 Eros Olmi (http://www.thinbasic.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/05/12
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* thinBasic language file for GeSHi.
*
diff --git a/inc/geshi/tsql.php b/inc/geshi/tsql.php
index 149b82bcd..d5e2b7f4a 100644
--- a/inc/geshi/tsql.php
+++ b/inc/geshi/tsql.php
@@ -4,10 +4,8 @@
* --------
* Author: Duncan Lock (dunc@dflock.co.uk)
* Copyright: (c) 2006 Duncan Lock (http://dflock.co.uk/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/11/22
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* T-SQL language file for GeSHi.
*
diff --git a/inc/geshi/vb.php b/inc/geshi/vb.php
index b41a02f55..1bef0228c 100644
--- a/inc/geshi/vb.php
+++ b/inc/geshi/vb.php
@@ -4,10 +4,8 @@
* ------
* Author: Roberto Rossi (rsoftware@altervista.org)
* Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/08/30
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* Visual Basic language file for GeSHi.
*
diff --git a/inc/geshi/vbnet.php b/inc/geshi/vbnet.php
index 79867ce32..a2a482d63 100644
--- a/inc/geshi/vbnet.php
+++ b/inc/geshi/vbnet.php
@@ -4,10 +4,8 @@
* ---------
* Author: Alan Juden (alan@judenware.org)
* Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/06/04
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* VB.NET language file for GeSHi.
*
diff --git a/inc/geshi/vhdl.php b/inc/geshi/vhdl.php
index cbaec9f78..c52794a2b 100644
--- a/inc/geshi/vhdl.php
+++ b/inc/geshi/vhdl.php
@@ -4,10 +4,8 @@
* --------
* Author: Alexander 'E-Razor' Krause (admin@erazor-zone.de)
* Copyright: (c) 2005 Alexander Krause
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2005/06/15
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* VHDL (VHSICADL, very high speed integrated circuit HDL) language file for GeSHi.
*
diff --git a/inc/geshi/visualfoxpro.php b/inc/geshi/visualfoxpro.php
index 6aff8a056..6cd70a524 100644
--- a/inc/geshi/visualfoxpro.php
+++ b/inc/geshi/visualfoxpro.php
@@ -4,10 +4,8 @@
* ----------------
* Author: Roberto Armellin (r.armellin@tin.it)
* Copyright: (c) 2004 Roberto Armellin, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/09/17
- * Last Modified: 2004/09/18
*
* Visual FoxPro language file for GeSHi.
*
diff --git a/inc/geshi/winbatch.php b/inc/geshi/winbatch.php
index 959d9adde..7f2d68a14 100644
--- a/inc/geshi/winbatch.php
+++ b/inc/geshi/winbatch.php
@@ -4,10 +4,8 @@
* ------------
* Author: Craig Storey (storey.craig@gmail.com)
* Copyright: (c) 2004 Craig Storey (craig.xcottawa.ca)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 870 $
+ * Release Version: 1.0.7.18
* Date Started: 2006/05/19
- * Last Modified: $Date: 2006-12-10 22:48:21 +1300 (Sun, 10 Dec 2006) $
*
* WinBatch language file for GeSHi.
*
diff --git a/inc/geshi/xml.php b/inc/geshi/xml.php
index 08a9c0c7f..2f41943e2 100644
--- a/inc/geshi/xml.php
+++ b/inc/geshi/xml.php
@@ -4,10 +4,8 @@
* -------
* Author: Nigel McNie (nigel@geshi.org)
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.17
- * CVS Revision Version: $Revision: 866 $
+ * Release Version: 1.0.7.18
* Date Started: 2004/09/01
- * Last Modified: $Date: 2006-11-26 21:40:26 +1300 (Sun, 26 Nov 2006) $
*
* XML language file for GeSHi. Based on the idea/file by Christian Weiske
*
diff --git a/inc/geshi/z80.php b/inc/geshi/z80.php
new file mode 100644
index 000000000..5800447f2
--- /dev/null
+++ b/inc/geshi/z80.php
@@ -0,0 +1,133 @@
+<?php
+/*************************************************************************************
+ * asm.php
+ * -------
+ * Author: Benny Baumann (BenBE@omorphia.de)
+ * Copyright: (c) 2007 Benny Baumann (http://www.omorphia.de/), Nigel McNie (http://qbnz.com/highlighter)
+ * Release Version: 1.0.7.18
+ * Date Started: 2007/02/06
+ *
+ * ZiLOG Z80 Assembler language file for GeSHi.
+ * Syntax definition as commonly used with table assembler TASM32
+ * This file will contain some undocumented opcodes.
+ *
+ * CHANGES
+ * -------
+ * 2007/02/06 (1.0.0)
+ * - First Release
+ *
+ * TODO (updated 2007/02/06)
+ * -------------------------
+ *
+ *************************************************************************************
+ *
+ * This file is part of GeSHi.
+ *
+ * GeSHi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GeSHi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GeSHi; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ ************************************************************************************/
+
+$language_data = array (
+ 'LANG_NAME' => 'ZiLOG Z80 Assembler',
+ 'COMMENT_SINGLE' => array(1 => ';'),
+ 'COMMENT_MULTI' => array(),
+ 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+ 'QUOTEMARKS' => array("'", '"'),
+ 'ESCAPE_CHAR' => '',
+ 'KEYWORDS' => array(
+ /*CPU*/
+ 1 => array(
+ 'adc','add'.'and','bit','call','ccf','cp','cpd','cpdr','cpir','cpi',
+ 'cpl','daa','dec','di','djnz','ei','ex','exx','halt','im','in',
+ 'in0','inc','ind','indr','inir','ini','jp','jr','ld','ldd','lddr',
+ 'ldir','ldi','mlt','neg','nop','or','otdm','otdmr','otdr','otim',
+ 'otimr','otir','out','out0','outd','outi','pop','push','res'.'ret',
+ 'reti','retn','rl','rla','rlc','rlca','rld','rr','rra','rrc','rrca',
+ 'rrd','rst','sbc','scf','set','sla','sl1','sll','slp','sra','srl',
+ 'sub','tst','tstio','xor'
+ ),
+ /*registers*/
+ 2 => array(
+ 'a','b','c','d','e','h','l',
+ 'af','bc','de','hl','ix','iy','sp',
+ 'af\'','ixh','ixl','iyh','iyl'
+ ),
+ /*Directive*/
+ 3 => array(
+ '#define','#endif','#else','#ifdef','#ifndef','#include','#undef',
+ '.db','.dd','.df','.dq','.dt','.dw','.end','.org','equ'
+ ),
+ ),
+ 'SYMBOLS' => array(
+ '[', ']', '(', ')', '?', '+', '-', '*', '/', '%', '$'
+ ),
+ 'CASE_SENSITIVE' => array(
+ GESHI_COMMENTS => true,
+ 1 => false,
+ 2 => false,
+ 3 => false,
+ ),
+ 'STYLES' => array(
+ 'KEYWORDS' => array(
+ 1 => 'color: #0000ff; font-weight:bold;',
+ 2 => 'color: #0000ff;',
+ 3 => 'color: #46aa03; font-weight:bold;'
+ ),
+ 'COMMENTS' => array(
+ 1 => 'color: #adadad; font-style: italic;',
+ ),
+ 'ESCAPE_CHAR' => array(
+ 0 => 'color: #000099; font-weight: bold;'
+ ),
+ 'BRACKETS' => array(
+ 0 => 'color: #0000ff;'
+ ),
+ 'STRINGS' => array(
+ 0 => 'color: #7f007f;'
+ ),
+ 'NUMBERS' => array(
+ 0 => 'color: #dd22dd;'
+ ),
+ 'METHODS' => array(
+ ),
+ 'SYMBOLS' => array(
+ 0 => 'color: #008000;'
+ ),
+ 'REGEXPS' => array(
+ 0 => 'color: #22bbff;',
+ 1 => 'color: #22bbff;',
+ 2 => 'color: #993333;'
+ ),
+ 'SCRIPT' => array(
+ )
+ ),
+ 'URLS' => array(
+ ),
+ 'OOLANG' => false,
+ 'OBJECT_SPLITTERS' => array(
+ ),
+ 'REGEXPS' => array(
+ 0 => '0[0-9a-fA-F][0-9a-fA-F]*[hH]',
+ 1 => '\%[01]+[bB]',
+ 2 => '^[_a-zA-Z][_a-zA-Z0-9]*\:'
+ ),
+ 'STRICT_MODE_APPLIES' => GESHI_NEVER,
+ 'SCRIPT_DELIMITERS' => array(
+ ),
+ 'HIGHLIGHT_STRICT_BLOCK' => array(
+ )
+);
+
+?>