summaryrefslogtreecommitdiffstats
path: root/paste/include/geshi/contexts/html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--paste/include/geshi/contexts/html/comment.php46
-rw-r--r--paste/include/geshi/contexts/html/css.php49
-rw-r--r--paste/include/geshi/contexts/html/doctype.php50
-rw-r--r--paste/include/geshi/contexts/html/html.php55
-rw-r--r--paste/include/geshi/contexts/html/javascript.php49
-rw-r--r--paste/include/geshi/contexts/html/string.php56
-rw-r--r--paste/include/geshi/contexts/html/string_javascript.php55
-rw-r--r--paste/include/geshi/contexts/html/tag.php98
8 files changed, 458 insertions, 0 deletions
diff --git a/paste/include/geshi/contexts/html/comment.php b/paste/include/geshi/contexts/html/comment.php
new file mode 100644
index 0000000..346b16b
--- /dev/null
+++ b/paste/include/geshi/contexts/html/comment.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('<!--'),
+ 1 => array('-->'),
+ 2 => false
+ )
+);
+
+$this->_styler->setStyle($CONTEXT, 'color:#888;');
+$this->_contextStyleType = GESHI_STYLE_COMMENTS;
+
+?>
diff --git a/paste/include/geshi/contexts/html/css.php b/paste/include/geshi/contexts/html/css.php
new file mode 100644
index 0000000..a6107f1
--- /dev/null
+++ b/paste/include/geshi/contexts/html/css.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ //@todo [blocking 1.1.9] The <![CDATA[ was added to stop CSS jumping into attribute selector context
+ //the moment it was encountered, but this only really applies to XML
+ 0 => array('REGEX#<style[^>]+>\s*(<!\[CDATA\[)?#i'),
+ 1 => array('</style>'),
+ 2 => false
+ )
+);
+
+$this->_delimiterParseData = GESHI_CHILD_PARSE_NONE;
+
+$this->_overridingChildContext =& new GeSHiCodeContext('css');
+
+?>
diff --git a/paste/include/geshi/contexts/html/doctype.php b/paste/include/geshi/contexts/html/doctype.php
new file mode 100644
index 0000000..818730c
--- /dev/null
+++ b/paste/include/geshi/contexts/html/doctype.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('<!DOCTYPE '),
+ 1 => array('>'),
+ 2 => false
+ )
+);
+
+$this->_childContexts = array(
+ // HTML strings have no escape characters, so the don't need to be GeSHiStringContexts
+ new GeSHiContext('html', $DIALECT, 'string')
+);
+
+$this->_styler->setStyle($CONTEXT, 'font-weight:bold;color:#933;');
+
+?>
diff --git a/paste/include/geshi/contexts/html/html.php b/paste/include/geshi/contexts/html/html.php
new file mode 100644
index 0000000..2e9169d
--- /dev/null
+++ b/paste/include/geshi/contexts/html/html.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_childContexts = array(
+ new GeSHiContext('html', $DIALECT, 'doctype'),
+ new GeSHiCodeContext('html', $DIALECT, 'tag'),
+ new GeSHiContext('html', $DIALECT, 'comment'),
+ new GeSHiContext('html', $DIALECT, 'css'),
+ new GeSHiContext('html', $DIALECT, 'javascript')
+);
+
+$this->_styler->setStyle($CONTEXT, 'color:#000;');
+
+$this->_contextRegexps = array(
+ 0 => array(
+ 0 => array('#(&(([a-z0-9]{2,5})|(\#[0-9]{2,4}));)#'),
+ 1 => '&',
+ 2 => array(
+ 1 => array($CONTEXT . '/entity', 'color: #00c;', false)
+ )
+ )
+);
+
+?>
diff --git a/paste/include/geshi/contexts/html/javascript.php b/paste/include/geshi/contexts/html/javascript.php
new file mode 100644
index 0000000..1ba7352
--- /dev/null
+++ b/paste/include/geshi/contexts/html/javascript.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('REGEX#<script[^>]+>#i'),
+ 1 => array('</script>'),
+ 2 => false
+ )
+);
+
+// If this is set to parse any of the delimiters, the OCC swallows it up - setStartStyle and
+// setEndStyle have no meaning in a context with an OCC (actually, nor does setStyle)
+$this->_delimiterParseData = GESHI_CHILD_PARSE_NONE;
+
+$this->_overridingChildContext = new GeSHiCodeContext('javascript');
+
+?>
diff --git a/paste/include/geshi/contexts/html/string.php b/paste/include/geshi/contexts/html/string.php
new file mode 100644
index 0000000..55149e5
--- /dev/null
+++ b/paste/include/geshi/contexts/html/string.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ // Each of ' and " delimiters. In their own group so they only end themselves
+ 0 => array(
+ 0 => array("'"),
+ 1 => array("'"),
+ 2 => false
+ ),
+ 1 => array(
+ 0 => array('"'),
+ 1 => array('"'),
+ 2 => false
+ )
+);
+
+$this->_childContexts = array(
+ new GeSHiContext('html', $DIALECT, 'string_javascript')
+);
+
+$this->_styler->setStyle($CONTEXT, 'color:#933;');
+$this->_contextStyleType = GESHI_STYLE_STRINGS;
+
+?>
diff --git a/paste/include/geshi/contexts/html/string_javascript.php b/paste/include/geshi/contexts/html/string_javascript.php
new file mode 100644
index 0000000..f210bc0
--- /dev/null
+++ b/paste/include/geshi/contexts/html/string_javascript.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+//@todo [blocking 1.1.1] (bug 11) Using a ^ before the starters does
+// not work, because when useless contexts are purged neither the ^return
+// nor the ^javascript: are matched so this context is removed.
+// I'm leaving it until 1.1.1 to solve this. One way might be to add a flag
+// to this array or a field to the GeSHiContext class that says "never remove
+// me, even if I am useless"
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('REGEX#return#', 'REGEX#javascript:#'),
+ 1 => array('"'),
+ 2 => false
+ )
+);
+
+// If this is set to parse any of the delimiters, the OCC swallows it up - setStartStyle and
+// setEndStyle have no meaning in a context with an OCC (actually, nor does setStyle)
+$this->_delimiterParseData = GESHI_CHILD_PARSE_LEFT;
+
+$this->_overridingChildContext = new GeSHiCodeContext('javascript');
+
+?>
diff --git a/paste/include/geshi/contexts/html/tag.php b/paste/include/geshi/contexts/html/tag.php
new file mode 100644
index 0000000..44bed38
--- /dev/null
+++ b/paste/include/geshi/contexts/html/tag.php
@@ -0,0 +1,98 @@
+<?php
+/**
+ * GeSHi - Generic Syntax Highlighter
+ *
+ * For information on how to use GeSHi, please consult the documentation
+ * found in the docs/ directory, or online at http://geshi.org/docs/
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * You can view a copy of the GNU GPL in the COPYING file that comes
+ * with GeSHi, in the docs/ directory.
+ *
+ * @package lang
+ * @author Nigel McNie <nigel@geshi.org>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
+ * @copyright (C) 2005 Nigel McNie
+ * @version 1.1.0
+ *
+ */
+
+$this->_contextDelimiters = array(
+ 0 => array(
+ 0 => array('REGEX#<[/a-z_0-6]+#i'),
+ 1 => array('>'),
+ 2 => false
+ )
+);
+
+$this->_childContexts = array(
+ // HTML strings have no escape characters, so the don't need to be GeSHiStringContexts
+ new GeSHiContext('html', $DIALECT, 'string')
+);
+
+$this->_styler->setStyle($CONTEXT, 'color:#008000;');
+$this->_styler->setStyle($CONTEXT_START, 'font-weight:bold;color:#000;');
+$this->_styler->setStyle($CONTEXT_END, 'font-weight:bold;color:#000;');
+
+$this->_contextKeywords = array(
+ 0 => array(
+ // keywords
+ 0 => array(
+ 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align',
+ 'alink', 'alt', 'archive', 'axis', 'background', 'bgcolor', 'border',
+ 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked',
+ 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype',
+ 'color', 'cols', 'colspan', 'compact', 'content', 'coords', 'data',
+ 'datetime', 'declare', 'defer', 'dir', 'disabled', 'enctype', 'face',
+ 'for', 'frame', 'frameborder', 'headers', 'height', 'href', 'hreflang',
+ 'hspace', 'http-equiv', 'id', 'ismap', 'label', 'lang', 'language',
+ 'link', 'longdesc', 'marginheight', 'marginwidth', 'maxlength', 'media',
+ 'method', 'multiple', 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
+ 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus',
+ 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown',
+ 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset',
+ 'onselect', 'onsubmit', 'onunload', 'profile', 'prompt', 'readonly',
+ 'rel', 'rev', 'rows', 'rowspan', 'rules', 'scheme', 'scope', 'scrolling',
+ 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style',
+ 'summary', 'tabindex', 'target', 'text', 'title', 'type', 'usemap',
+ 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace', 'width'
+ ),
+ // name
+ 1 => $CONTEXT . '/attrs',
+ // style
+ 2 => 'color:#006;',
+ // case sensitive
+ 3 => false,
+ // url
+ 4 => ''
+ )
+);
+
+$this->_contextSymbols = array(
+ 0 => array(
+ 0 => array(
+ '='
+ ),
+ // name (should names have / in them like normal contexts? YES
+ 1 => $CONTEXT . '/sym',
+ // style
+ 2 => 'color:#008000;'
+ )
+);
+
+?>