From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/highlight/README | 31 ++ includes/js/dojox/highlight/_base.js | 406 +++++++++++++++++++++ includes/js/dojox/highlight/languages/_all.js | 11 + includes/js/dojox/highlight/languages/_dynamic.js | 11 + includes/js/dojox/highlight/languages/_static.js | 10 + includes/js/dojox/highlight/languages/_www.js | 12 + includes/js/dojox/highlight/languages/cpp.js | 53 +++ includes/js/dojox/highlight/languages/css.js | 96 +++++ includes/js/dojox/highlight/languages/delphi.js | 122 +++++++ includes/js/dojox/highlight/languages/django.js | 97 +++++ includes/js/dojox/highlight/languages/html.js | 70 ++++ .../js/dojox/highlight/languages/javascript.js | 55 +++ .../js/dojox/highlight/languages/pygments/_html.js | 25 ++ .../js/dojox/highlight/languages/pygments/_www.js | 12 + .../js/dojox/highlight/languages/pygments/css.js | 211 +++++++++++ .../js/dojox/highlight/languages/pygments/html.js | 101 +++++ .../highlight/languages/pygments/javascript.js | 152 ++++++++ .../js/dojox/highlight/languages/pygments/xml.js | 79 ++++ includes/js/dojox/highlight/languages/python.js | 102 ++++++ includes/js/dojox/highlight/languages/sql.js | 101 +++++ includes/js/dojox/highlight/languages/xml.js | 69 ++++ .../js/dojox/highlight/resources/highlight.css | 51 +++ .../resources/highlight.css.commented.css | 58 +++ .../dojox/highlight/resources/pygments/autumn.css | 22 ++ .../resources/pygments/autumn.css.commented.css | 28 ++ .../dojox/highlight/resources/pygments/borland.css | 11 + .../resources/pygments/borland.css.commented.css | 17 + .../highlight/resources/pygments/colorful.css | 37 ++ .../resources/pygments/colorful.css.commented.css | 43 +++ .../dojox/highlight/resources/pygments/default.css | 28 ++ .../resources/pygments/default.css.commented.css | 35 ++ .../dojox/highlight/resources/pygments/emacs.css | 29 ++ .../resources/pygments/emacs.css.commented.css | 36 ++ .../highlight/resources/pygments/friendly.css | 29 ++ .../resources/pygments/friendly.css.commented.css | 36 ++ .../dojox/highlight/resources/pygments/fruity.css | 14 + .../resources/pygments/fruity.css.commented.css | 20 + .../dojox/highlight/resources/pygments/manni.css | 30 ++ .../resources/pygments/manni.css.commented.css | 37 ++ .../dojox/highlight/resources/pygments/murphy.css | 37 ++ .../resources/pygments/murphy.css.commented.css | 43 +++ .../dojox/highlight/resources/pygments/native.css | 21 ++ .../resources/pygments/native.css.commented.css | 28 ++ .../dojox/highlight/resources/pygments/pastie.css | 30 ++ .../resources/pygments/pastie.css.commented.css | 36 ++ .../dojox/highlight/resources/pygments/perldoc.css | 23 ++ .../resources/pygments/perldoc.css.commented.css | 30 ++ .../js/dojox/highlight/resources/pygments/trac.css | 20 + .../resources/pygments/trac.css.commented.css | 26 ++ .../js/dojox/highlight/tests/test_highlight.html | 327 +++++++++++++++++ .../js/dojox/highlight/tests/test_pygments.html | 142 +++++++ 51 files changed, 3150 insertions(+) create mode 100644 includes/js/dojox/highlight/README create mode 100644 includes/js/dojox/highlight/_base.js create mode 100644 includes/js/dojox/highlight/languages/_all.js create mode 100644 includes/js/dojox/highlight/languages/_dynamic.js create mode 100644 includes/js/dojox/highlight/languages/_static.js create mode 100644 includes/js/dojox/highlight/languages/_www.js create mode 100644 includes/js/dojox/highlight/languages/cpp.js create mode 100644 includes/js/dojox/highlight/languages/css.js create mode 100644 includes/js/dojox/highlight/languages/delphi.js create mode 100644 includes/js/dojox/highlight/languages/django.js create mode 100644 includes/js/dojox/highlight/languages/html.js create mode 100644 includes/js/dojox/highlight/languages/javascript.js create mode 100644 includes/js/dojox/highlight/languages/pygments/_html.js create mode 100644 includes/js/dojox/highlight/languages/pygments/_www.js create mode 100644 includes/js/dojox/highlight/languages/pygments/css.js create mode 100644 includes/js/dojox/highlight/languages/pygments/html.js create mode 100644 includes/js/dojox/highlight/languages/pygments/javascript.js create mode 100644 includes/js/dojox/highlight/languages/pygments/xml.js create mode 100644 includes/js/dojox/highlight/languages/python.js create mode 100644 includes/js/dojox/highlight/languages/sql.js create mode 100644 includes/js/dojox/highlight/languages/xml.js create mode 100644 includes/js/dojox/highlight/resources/highlight.css create mode 100644 includes/js/dojox/highlight/resources/highlight.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/autumn.css create mode 100644 includes/js/dojox/highlight/resources/pygments/autumn.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/borland.css create mode 100644 includes/js/dojox/highlight/resources/pygments/borland.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/colorful.css create mode 100644 includes/js/dojox/highlight/resources/pygments/colorful.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/default.css create mode 100644 includes/js/dojox/highlight/resources/pygments/default.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/emacs.css create mode 100644 includes/js/dojox/highlight/resources/pygments/emacs.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/friendly.css create mode 100644 includes/js/dojox/highlight/resources/pygments/friendly.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/fruity.css create mode 100644 includes/js/dojox/highlight/resources/pygments/fruity.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/manni.css create mode 100644 includes/js/dojox/highlight/resources/pygments/manni.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/murphy.css create mode 100644 includes/js/dojox/highlight/resources/pygments/murphy.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/native.css create mode 100644 includes/js/dojox/highlight/resources/pygments/native.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/pastie.css create mode 100644 includes/js/dojox/highlight/resources/pygments/pastie.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/perldoc.css create mode 100644 includes/js/dojox/highlight/resources/pygments/perldoc.css.commented.css create mode 100644 includes/js/dojox/highlight/resources/pygments/trac.css create mode 100644 includes/js/dojox/highlight/resources/pygments/trac.css.commented.css create mode 100644 includes/js/dojox/highlight/tests/test_highlight.html create mode 100644 includes/js/dojox/highlight/tests/test_pygments.html (limited to 'includes/js/dojox/highlight') diff --git a/includes/js/dojox/highlight/README b/includes/js/dojox/highlight/README new file mode 100644 index 0000000..cdaed12 --- /dev/null +++ b/includes/js/dojox/highlight/README @@ -0,0 +1,31 @@ +------------------------------------------------------------------------------- +dojox.highlight +------------------------------------------------------------------------------- +Version 1.0 +Release date: 11/25/2007 +------------------------------------------------------------------------------- +Project state: +beta +------------------------------------------------------------------------------- +Credits + Ivan Sagalaev (softwaremaniacs.org) Author + Peter Higgins (dante) Dojo port +------------------------------------------------------------------------------- +Project description + +A syntax highlighting engine for the Dojo Toolkit +------------------------------------------------------------------------------- +Dependencies: + +dojo base only. +------------------------------------------------------------------------------- +Documentation + +------------------------------------------------------------------------------- +Installation instructions + +simply get the dojox/highlight folder (and dojox/highlight.js) from the +dojox SVN repository, and include in your page via + +dojo.require("dojox.highlight"); + diff --git a/includes/js/dojox/highlight/_base.js b/includes/js/dojox/highlight/_base.js new file mode 100644 index 0000000..46b5267 --- /dev/null +++ b/includes/js/dojox/highlight/_base.js @@ -0,0 +1,406 @@ +if(!dojo._hasResource["dojox.highlight._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.highlight._base"] = true; +dojo.provide("dojox.highlight._base"); + +// +// dojox.highlight - syntax highlighting with language auto-detection +// released under CLA by the Dojo Toolkit +// orig BSD release available from: http://softwaremaniacs.org/soft/highlight/ +// + +(function(){ + var dh = dojox.highlight, + C_NUMBER_RE = '\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)'; + + // constants + + dh.constants = { + IDENT_RE: '[a-zA-Z][a-zA-Z0-9_]*', + UNDERSCORE_IDENT_RE: '[a-zA-Z_][a-zA-Z0-9_]*', + NUMBER_RE: '\\b\\d+(\\.\\d+)?', + C_NUMBER_RE: C_NUMBER_RE, + // Common modes + APOS_STRING_MODE: { + className: 'string', + begin: '\'', end: '\'', + illegal: '\\n', + contains: ['escape'], + relevance: 0 + }, + QUOTE_STRING_MODE: { + className: 'string', + begin: '"', + end: '"', + illegal: '\\n', + contains: ['escape'], + relevance: 0 + }, + BACKSLASH_ESCAPE: { + className: 'escape', + begin: '\\\\.', end: '^', + relevance: 0 + }, + C_LINE_COMMENT_MODE: { + className: 'comment', + begin: '//', end: '$', + relevance: 0 + }, + C_BLOCK_COMMENT_MODE: { + className: 'comment', + begin: '/\\*', end: '\\*/' + }, + HASH_COMMENT_MODE: { + className: 'comment', + begin: '#', end: '$' + }, + C_NUMBER_MODE: { + className: 'number', + begin: C_NUMBER_RE, end: '^', + relevance: 0 + } + }; + + // utilities + + function esc(value){ + return value.replace(/&/gm, '&').replace(//gm, '>'); + } + + function verifyText(block){ + return dojo.every(block.childNodes, function(node){ + return node.nodeType == 3 || String(node.nodeName).toLowerCase() == 'br'; + }); + } + + function blockText(block){ + var result = []; + dojo.forEach(block.childNodes, function(node){ + if(node.nodeType == 3){ + result.push(node.nodeValue); + }else if(String(node.nodeName).toLowerCase() == 'br'){ + result.push("\n"); + }else{ + throw 'Complex markup'; + } + }); + return result.join(""); + } + + function buildKeywordGroups(mode){ + if(!mode.keywordGroups){ + for(var key in mode.keywords){ + var kw = mode.keywords[key]; + if(kw instanceof Object){ // dojo.isObject? + mode.keywordGroups = mode.keywords; + }else{ + mode.keywordGroups = {keyword: mode.keywords}; + } + break; + } + } + } + + function buildKeywords(lang){ + if(lang.defaultMode && lang.modes){ + buildKeywordGroups(lang.defaultMode); + dojo.forEach(lang.modes, buildKeywordGroups); + } + } + + // main object + + var Highlighter = function(langName, textBlock){ + // initialize the state + this.langName = langName; + this.lang = dh.languages[langName]; + this.modes = [this.lang.defaultMode]; + this.relevance = 0; + this.keywordCount = 0; + this.result = []; + + // build resources lazily + if(!this.lang.defaultMode.illegalRe){ + this.buildRes(); + buildKeywords(this.lang); + } + + // run the algorithm + try{ + this.highlight(textBlock); + this.result = this.result.join(""); + }catch(e){ + if(e == 'Illegal'){ + this.relevance = 0; + this.keywordCount = 0; + this.result = esc(textBlock); + }else{ + throw e; + } + } + }; + + dojo.extend(Highlighter, { + buildRes: function(){ + dojo.forEach(this.lang.modes, function(mode){ + if(mode.begin){ + mode.beginRe = this.langRe('^' + mode.begin); + } + if(mode.end){ + mode.endRe = this.langRe('^' + mode.end); + } + if(mode.illegal){ + mode.illegalRe = this.langRe('^(?:' + mode.illegal + ')'); + } + }, this); + this.lang.defaultMode.illegalRe = this.langRe('^(?:' + this.lang.defaultMode.illegal + ')'); + }, + + subMode: function(lexeme){ + var classes = this.modes[this.modes.length - 1].contains; + if(classes){ + var modes = this.lang.modes; + for(var i = 0; i < classes.length; ++i){ + var className = classes[i]; + for(var j = 0; j < modes.length; ++j){ + var mode = modes[j]; + if(mode.className == className && mode.beginRe.test(lexeme)){ return mode; } + } + } + } + return null; + }, + + endOfMode: function(lexeme){ + for(var i = this.modes.length - 1; i >= 0; --i){ + var mode = this.modes[i]; + if(mode.end && mode.endRe.test(lexeme)){ return this.modes.length - i; } + if(!mode.endsWithParent){ break; } + } + return 0; + }, + + isIllegal: function(lexeme){ + var illegalRe = this.modes[this.modes.length - 1].illegalRe; + return illegalRe && illegalRe.test(lexeme); + }, + + + langRe: function(value, global){ + var mode = 'm' + (this.lang.case_insensitive ? 'i' : '') + (global ? 'g' : ''); + return new RegExp(value, mode); + }, + + buildTerminators: function(){ + var mode = this.modes[this.modes.length - 1], + terminators = {}; + if(mode.contains){ + dojo.forEach(this.lang.modes, function(lmode){ + if(dojo.indexOf(mode.contains, lmode.className) >= 0){ + terminators[lmode.begin] = 1; + } + }); + } + for(var i = this.modes.length - 1; i >= 0; --i){ + var m = this.modes[i]; + if(m.end){ terminators[m.end] = 1; } + if(!m.endsWithParent){ break; } + } + if(mode.illegal){ terminators[mode.illegal] = 1; } + var t = []; + for(i in terminators){ t.push(i); } + mode.terminatorsRe = this.langRe("(" + t.join("|") + ")"); + }, + + eatModeChunk: function(value, index){ + var mode = this.modes[this.modes.length - 1]; + + // create terminators lazily + if(!mode.terminatorsRe){ + this.buildTerminators(); + } + + value = value.substr(index); + var match = mode.terminatorsRe.exec(value); + if(!match){ + return { + buffer: value, + lexeme: "", + end: true + }; + } + return { + buffer: match.index ? value.substr(0, match.index) : "", + lexeme: match[0], + end: false + }; + }, + + keywordMatch: function(mode, match){ + var matchStr = match[0]; + if(this.lang.case_insensitive){ matchStr = matchStr.toLowerCase(); } + for(var className in mode.keywordGroups){ + if(matchStr in mode.keywordGroups[className]){ return className; } + } + return ""; + }, + + buildLexemes: function(mode){ + var lexemes = {}; + dojo.forEach(mode.lexems, function(lexeme){ + lexemes[lexeme] = 1; + }); + var t = []; + for(var i in lexemes){ t.push(i); } + mode.lexemsRe = this.langRe("(" + t.join("|") + ")", true); + }, + + processKeywords: function(buffer){ + var mode = this.modes[this.modes.length - 1]; + if(!mode.keywords || !mode.lexems){ + return esc(buffer); + } + + // create lexemes lazily + if(!mode.lexemsRe){ + this.buildLexemes(mode); + } + + mode.lexemsRe.lastIndex = 0; + var result = [], lastIndex = 0, + match = mode.lexemsRe.exec(buffer); + while(match){ + result.push(esc(buffer.substr(lastIndex, match.index - lastIndex))); + var keywordM = this.keywordMatch(mode, match); + if(keywordM){ + ++this.keywordCount; + result.push('' + esc(match[0]) + ''); + }else{ + result.push(esc(match[0])); + } + lastIndex = mode.lexemsRe.lastIndex; + match = mode.lexemsRe.exec(buffer); + } + result.push(esc(buffer.substr(lastIndex, buffer.length - lastIndex))); + return result.join(""); + }, + + processModeInfo: function(buffer, lexeme, end) { + var mode = this.modes[this.modes.length - 1]; + if(end){ + this.result.push(this.processKeywords(mode.buffer + buffer)); + return; + } + if(this.isIllegal(lexeme)){ throw 'Illegal'; } + var newMode = this.subMode(lexeme); + if(newMode){ + mode.buffer += buffer; + this.result.push(this.processKeywords(mode.buffer)); + if(newMode.excludeBegin){ + this.result.push(lexeme + ''); + newMode.buffer = ''; + }else{ + this.result.push(''); + newMode.buffer = lexeme; + } + this.modes.push(newMode); + this.relevance += typeof newMode.relevance == "number" ? newMode.relevance : 1; + return; + } + var endLevel = this.endOfMode(lexeme); + if(endLevel){ + mode.buffer += buffer; + if(mode.excludeEnd){ + this.result.push(this.processKeywords(mode.buffer) + '' + lexeme); + }else{ + this.result.push(this.processKeywords(mode.buffer + lexeme) + ''); + } + while(endLevel > 1){ + this.result.push(''); + --endLevel; + this.modes.pop(); + } + this.modes.pop(); + this.modes[this.modes.length - 1].buffer = ''; + return; + } + }, + + highlight: function(value){ + var index = 0; + this.lang.defaultMode.buffer = ''; + do{ + var modeInfo = this.eatModeChunk(value, index); + this.processModeInfo(modeInfo.buffer, modeInfo.lexeme, modeInfo.end); + index += modeInfo.buffer.length + modeInfo.lexeme.length; + }while(!modeInfo.end); + if(this.modes.length > 1){ + throw 'Illegal'; + } + } + }); + + // more utilities + + function replaceText(node, className, text){ + if(String(node.tagName).toLowerCase() == "code" && String(node.parentNode.tagName).toLowerCase() == "pre"){ + // See these 4 lines? This is IE's notion of "node.innerHTML = text". Love this browser :-/ + var container = document.createElement('div'), + environment = node.parentNode.parentNode; + container.innerHTML = '
' + text + '
';
+ environment.replaceChild(container.firstChild, node.parentNode);
+ }else{
+ node.className = className;
+ node.innerHTML = text;
+ }
+ }
+
+ function highlightLanguage(block, lang){
+ var highlight = new Highlighter(lang, blockText(block));
+ replaceText(block, block.className, highlight.result);
+ }
+
+ function highlightAuto(block){
+ var result = "", langName = "", bestRelevance = 2,
+ textBlock = blockText(block);
+ for(var key in dh.languages){
+ if(!dh.languages[key].defaultMode){ continue; } // skip internal members
+ var highlight = new Highlighter(key, textBlock),
+ relevance = highlight.keywordCount + highlight.relevance;
+ if(!result || relevance > relevanceMax){
+ relevanceMax = relevance;
+ result = highlight.result;
+ langName = highlight.langName;
+ }
+ }
+ if(result){
+ replaceText(block, langName, result);
+ }
+ }
+
+ // the public API
+
+ dh.init = function(/* DomNode */ block){
+ // summary: the main (only required) public API. highlight a node.
+ if(dojo.hasClass(block,"no-highlight")){ return; }
+ if(!verifyText(block)){ return; }
+
+ var classes = block.className.split(/\s+/),
+ flag = dojo.some(classes, function(className){
+ if(className.charAt(0) != "_" && dh.languages[className]){
+ highlightLanguage(block, className);
+ return true; // stop iterations
+ }
+ return false; // continue iterations
+ });
+ if(!flag){
+ highlightAuto(block);
+ }
+ };
+
+ // pseudo object for markup creation
+ dh.Code = function(params, node){
+ dh.init(node);
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/_all.js b/includes/js/dojox/highlight/languages/_all.js
new file mode 100644
index 0000000..5097046
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/_all.js
@@ -0,0 +1,11 @@
+if(!dojo._hasResource["dojox.highlight.languages._all"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages._all"] = true;
+dojo.provide("dojox.highlight.languages._all");
+
+/* groups of similar languages */
+dojo.require("dojox.highlight.languages._static");
+dojo.require("dojox.highlight.languages._dynamic");
+dojo.require("dojox.highlight.languages._www");
+
+
+}
diff --git a/includes/js/dojox/highlight/languages/_dynamic.js b/includes/js/dojox/highlight/languages/_dynamic.js
new file mode 100644
index 0000000..a3b510b
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/_dynamic.js
@@ -0,0 +1,11 @@
+if(!dojo._hasResource["dojox.highlight.languages._dynamic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages._dynamic"] = true;
+dojo.provide("dojox.highlight.languages._dynamic");
+
+/* common scripted languages */
+dojo.require("dojox.highlight.languages.python");
+// dojo.require("dojox.highlight.languages.perl");
+// dojo.require("dojox.highlight.languages.php");
+// dojo.require("dojox.highlight.languages.ruby");
+
+}
diff --git a/includes/js/dojox/highlight/languages/_static.js b/includes/js/dojox/highlight/languages/_static.js
new file mode 100644
index 0000000..85212b4
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/_static.js
@@ -0,0 +1,10 @@
+if(!dojo._hasResource["dojox.highlight.languages._static"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages._static"] = true;
+dojo.provide("dojox.highlight.languages._static");
+
+/* common static languages */
+dojo.require("dojox.highlight.languages.cpp")
+// dojo.require("dojox.highlight.languages.java");
+dojo.require("dojox.highlight.languages.delphi");
+
+}
diff --git a/includes/js/dojox/highlight/languages/_www.js b/includes/js/dojox/highlight/languages/_www.js
new file mode 100644
index 0000000..a04f073
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/_www.js
@@ -0,0 +1,12 @@
+if(!dojo._hasResource["dojox.highlight.languages._www"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages._www"] = true;
+dojo.provide("dojox.highlight.languages._www");
+
+/* common web-centric languages */
+dojo.require("dojox.highlight.languages.xml");
+dojo.require("dojox.highlight.languages.html");
+dojo.require("dojox.highlight.languages.css");
+dojo.require("dojox.highlight.languages.django");
+dojo.require("dojox.highlight.languages.javascript");
+
+}
diff --git a/includes/js/dojox/highlight/languages/cpp.js b/includes/js/dojox/highlight/languages/cpp.js
new file mode 100644
index 0000000..1e9edf2
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/cpp.js
@@ -0,0 +1,53 @@
+if(!dojo._hasResource["dojox.highlight.languages.cpp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.cpp"] = true;
+dojo.provide("dojox.highlight.languages.cpp");
+
+dojo.require("dojox.highlight._base");
+
+(function(){
+ var dh = dojox.highlight, dhc = dh.constants;
+ dh.languages.cpp = {
+ // summary: C++ highlight definitions
+ defaultMode: {
+ lexems: [dhc.UNDERSCORE_IDENT_RE],
+ illegal: '',
+ contains: ['comment', 'string', 'number', 'preprocessor'],
+ keywords: {
+ 'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1,
+ 'char': 1, 'catch': 1, 'export': 1, 'virtual': 1,
+ 'operator': 2, 'sizeof': 2, 'dynamic_cast': 2, 'typedef': 2,
+ 'const_cast': 2, 'const': 1, 'struct': 1, 'for': 1,
+ 'static_cast': 2, 'union': 1, 'namespace': 1, 'unsigned': 1,
+ 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1,
+ 'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1,
+ 'if': 1, 'public': 1, 'friend': 2, 'do': 1, 'return': 1,
+ 'goto': 1, 'auto': 1, 'void': 2, 'enum': 1, 'else': 1,
+ 'break': 1, 'new': 1, 'extern': 1, 'using': 1, 'true': 1,
+ 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1, 'short': 1,
+ 'reinterpret_cast': 2, 'default': 1, 'double': 1,
+ 'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1,
+ 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1,
+ 'inline': 1, 'delete': 1
+ }
+ },
+ modes: [
+ dhc.C_LINE_COMMENT_MODE,
+ dhc.C_BLOCK_COMMENT_MODE,
+ dhc.C_NUMBER_MODE,
+ dhc.QUOTE_STRING_MODE,
+ dhc.BACKSLASH_ESCAPE,
+ {
+ className: 'string',
+ begin: '\'',
+ end: '[^\\\\]\'',
+ illegal: '[^\\\\][^\']'
+ },
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$'
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/css.js b/includes/js/dojox/highlight/languages/css.js
new file mode 100644
index 0000000..7dfead0
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/css.js
@@ -0,0 +1,96 @@
+if(!dojo._hasResource["dojox.highlight.languages.css"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.css"] = true;
+dojo.provide("dojox.highlight.languages.css");
+
+dojo.require("dojox.highlight._base");
+dojo.require("dojox.highlight.languages.html");
+
+(function(){
+ var dh = dojox.highlight, dhc = dh.constants, dhl = dh.languages;
+ dhl.css = {
+ defaultMode: {
+ contains: ['id', 'class', 'attr_selector', 'rules', 'comment'],
+ keywords: dhl.html.HTML_TAGS,
+ lexems: [dhc.IDENT_RE],
+ illegal: '='
+ },
+ case_insensitive: true,
+ modes: [
+ {
+ className: 'id',
+ begin: '\\#[A-Za-z0-9_-]+', end: '^'
+ },
+ {
+ className: 'class',
+ begin: '\\.[A-Za-z0-9_-]+', end: '^',
+ relevance: 0
+ },
+ {
+ className: 'attr_selector',
+ begin: '\\[', end: '\\]',
+ illegal: '$'
+ },
+ {
+ className: 'rules',
+ begin: '{', end: '}',
+ lexems: ['[A-Za-z-]+'],
+ keywords: {
+ 'play-during': 1, 'counter-reset': 1,
+ 'counter-increment': 1, 'min-height': 1, 'quotes': 1,
+ 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1,
+ 'list-style-image': 1, 'border-width': 1, 'cue': 1,
+ 'outline-width': 1, 'border-left': 1, 'elevation': 1,
+ 'richness': 1, 'speech-rate': 1, 'border-bottom': 1,
+ 'border-spacing': 1, 'background': 1, 'list-style-type': 1,
+ 'text-align': 1, 'page-break-inside': 1, 'orphans': 1,
+ 'page-break-before': 1, 'text-transform': 1,
+ 'line-height': 1, 'padding-left': 1, 'font-size': 1,
+ 'right': 1, 'word-spacing': 1, 'padding-top': 1,
+ 'outline-style': 1, 'bottom': 1, 'content': 1,
+ 'border-right-style': 1, 'padding-right': 1,
+ 'border-left-style': 1, 'voice-family': 1,
+ 'background-color': 1, 'border-bottom-color': 1,
+ 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1,
+ 'font-family': 1, 'caption-side': 1,
+ 'border-right-width': 1, 'pause-before': 1,
+ 'border-top-style': 1, 'color': 1, 'border-collapse': 1,
+ 'border-bottom-width': 1, 'float': 1, 'height': 1,
+ 'max-height': 1, 'margin-right': 1, 'border-top-width': 1,
+ 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1,
+ 'min-width': 1, 'width': 1, 'font-variant': 1,
+ 'border-top-color': 1, 'background-position': 1,
+ 'empty-cells': 1, 'direction': 1, 'border-right': 1,
+ 'visibility': 1, 'padding': 1, 'border-style': 1,
+ 'background-attachment': 1, 'overflow': 1,
+ 'border-bottom-style': 1, 'cursor': 1, 'margin': 1,
+ 'display': 1, 'border-left-width': 1, 'letter-spacing': 1,
+ 'vertical-align': 1, 'clip': 1, 'border-color': 1,
+ 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1,
+ 'speak-numeral': 1, 'margin-left': 1, 'widows': 1,
+ 'border': 1, 'font-style': 1, 'border-left-color': 1,
+ 'pitch-range': 1, 'background-repeat': 1,
+ 'table-layout': 1, 'margin-bottom': 1,
+ 'speak-punctuation': 1, 'font-weight': 1,
+ 'border-right-color': 1, 'page-break-after': 1,
+ 'position': 1, 'white-space': 1, 'text-indent': 1,
+ 'background-image': 1, 'volume': 1, 'stress': 1,
+ 'outline': 1, 'clear': 1, 'z-index': 1,
+ 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1,
+ 'cue-after': 1, 'left': 1, 'list-style-position': 1
+ },
+ contains: ['comment', 'value']
+ },
+ dhc.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'value',
+ begin: ':',
+ end: ';',
+ endsWithParent: true,
+ excludeBegin: true,
+ excludeEnd: true
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/delphi.js b/includes/js/dojox/highlight/languages/delphi.js
new file mode 100644
index 0000000..ac97409
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/delphi.js
@@ -0,0 +1,122 @@
+if(!dojo._hasResource["dojox.highlight.languages.delphi"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.delphi"] = true;
+dojo.provide("dojox.highlight.languages.delphi");
+
+dojo.require("dojox.highlight._base");
+
+(function(){
+ var DELPHI_KEYWORDS = {
+ 'and': 1, 'safecall': 1, 'cdecl': 1, 'then': 1, 'string': 1,
+ 'exports': 1, 'library': 1, 'not': 1, 'pascal': 1, 'set': 1,
+ 'virtual': 1, 'file': 1, 'in': 1, 'array': 1, 'label': 1, 'packed': 1,
+ 'end.': 1, 'index': 1, 'while': 1, 'const': 1, 'raise': 1, 'for': 1,
+ 'to': 1, 'implementation': 1, 'with': 1, 'except': 1, 'overload': 1,
+ 'destructor': 1, 'downto': 1, 'finally': 1, 'program': 1, 'exit': 1,
+ 'unit': 1, 'inherited': 1, 'override': 1, 'if': 1, 'type': 1,
+ 'until': 1, 'function': 1, 'do': 1, 'begin': 1, 'repeat': 1, 'goto': 1,
+ 'nil': 1, 'far': 1, 'initialization': 1, 'object': 1, 'else': 1,
+ 'var': 1, 'uses': 1, 'external': 1, 'resourcestring': 1,
+ 'interface': 1, 'end': 1, 'finalization': 1, 'class': 1, 'asm': 1,
+ 'mod': 1, 'case': 1, 'on': 1, 'shr': 1, 'shl': 1, 'of': 1,
+ 'register': 1, 'xorwrite': 1, 'threadvar': 1, 'try': 1, 'record': 1,
+ 'near': 1, 'stored': 1, 'constructor': 1, 'stdcall': 1, 'inline': 1,
+ 'div': 1, 'out': 1, 'or': 1, 'procedure': 1
+ };
+ var DELPHI_CLASS_KEYWORDS = {
+ 'safecall': 1, 'stdcall': 1, 'pascal': 1, 'stored': 1, 'const': 1,
+ 'implementation': 1, 'finalization': 1, 'except': 1, 'to': 1,
+ 'finally': 1, 'program': 1, 'inherited': 1, 'override': 1, 'then': 1,
+ 'exports': 1, 'string': 1, 'read': 1, 'not': 1, 'mod': 1, 'shr': 1,
+ 'try': 1, 'div': 1, 'shl': 1, 'set': 1, 'library': 1, 'message': 1,
+ 'packed': 1, 'index': 1, 'for': 1, 'near': 1, 'overload': 1,
+ 'label': 1, 'downto': 1, 'exit': 1, 'public': 1, 'goto': 1,
+ 'interface': 1, 'asm': 1, 'on': 1, 'of': 1, 'constructor': 1, 'or': 1,
+ 'private': 1, 'array': 1, 'unit': 1, 'raise': 1, 'destructor': 1,
+ 'var': 1, 'type': 1, 'until': 1, 'function': 1, 'else': 1,
+ 'external': 1, 'with': 1, 'case': 1, 'default': 1, 'record': 1,
+ 'while': 1, 'protected': 1, 'property': 1, 'procedure': 1,
+ 'published': 1, 'and': 1, 'cdecl': 1, 'do': 1, 'threadvar': 1,
+ 'file': 1, 'in': 1, 'if': 1, 'end': 1, 'virtual': 1, 'write': 1,
+ 'far': 1, 'out': 1, 'begin': 1, 'repeat': 1, 'nil': 1,
+ 'initialization': 1, 'object': 1, 'uses': 1, 'resourcestring': 1,
+ 'class': 1, 'register': 1, 'xorwrite': 1, 'inline': 1
+ };
+
+ var dh = dojox.highlight, dhc = dh.constants;
+ dh.languages.delphi = {
+ defaultMode: {
+ lexems: [dhc.IDENT_RE],
+ illegal: '("|\\$[G-Zg-z]|\\/\\*|)',
+ contains: ['comment', 'string', 'number', 'function', 'class'],
+ keywords: DELPHI_KEYWORDS
+ },
+ case_insensitive: true,
+ modes: [
+ {
+ className: 'comment',
+ begin: '{', end: '}'
+ },
+ {
+ className: 'comment',
+ begin: '\\(\\*', end: '\\*\\)',
+ relevance: 10
+ },
+ dhc.C_LINE_COMMENT_MODE,
+ {
+ className: 'number',
+ begin: dhc.NUMBER_RE, end: '^',
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: ['quote'],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: '(#\\d+)+', end: '^'
+ },
+ {
+ className: 'quote',
+ begin: '\'\'', end: '^'
+ },
+ {
+ className: 'function',
+ begin: 'function', end: '[:;]',
+ lexems: [dhc.IDENT_RE],
+ keywords: {'function': 1},
+ contains: ['title', 'params', 'comment'],
+ relevance: 0
+ },
+ {
+ className: 'function',
+ begin: '(procedure|constructor|destructor)', end: ';',
+ lexems: [dhc.IDENT_RE],
+ keywords: {'constructor': 1, 'destructor': 1, 'procedure': 1},
+ contains: ['title', 'params', 'comment'],
+ relevance: 10
+ },
+ {
+ className: 'title',
+ begin: dhc.IDENT_RE, end: '^'
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ lexems: [dhc.IDENT_RE],
+ keywords: DELPHI_KEYWORDS,
+ contains: ['string']
+ },
+ {
+ className: 'class',
+ begin: '=\\s*class', end: 'end;',
+ lexems: [dhc.IDENT_RE],
+ keywords: DELPHI_CLASS_KEYWORDS,
+ contains: ['string', 'comment', 'function']
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/django.js b/includes/js/dojox/highlight/languages/django.js
new file mode 100644
index 0000000..26d483c
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/django.js
@@ -0,0 +1,97 @@
+if(!dojo._hasResource["dojox.highlight.languages.django"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.django"] = true;
+dojo.provide("dojox.highlight.languages.django");
+
+dojo.require("dojox.highlight._base");
+dojo.require("dojox.highlight.languages.xml");
+dojo.require("dojox.highlight.languages.html");
+
+(function(){
+ var dh = dojox.highlight, dhc = dh.constants, dhl = dh.languages, x = dhl.xml, h = dhl.html;
+ dhl.django = {
+ defaultMode: {
+ contains: ['tag', 'comment', 'doctype', 'template_comment', 'template_tag', 'variable']
+ },
+ case_insensitive: true,
+ modes: [
+ x.XML_COMMENT,
+ h.HTML_DOCTYPE,
+ {
+ className: 'tag',
+ lexems: [dhc.IDENT_RE],
+ keywords: h.HTML_TAGS,
+ begin: '<[A-Za-z/]', end: '>',
+ contains: ['attribute', 'template_comment', 'template_tag', 'variable']
+ },
+ x.XML_ATTR,
+ h.HTML_ATTR,
+ {
+ className: 'value',
+ begin: '"', end: '"',
+ contains: ['template_comment', 'template_tag', 'variable']
+ },
+ h.HTML_VALUE,
+ {
+ className: 'template_comment',
+ begin: '\\{\\%\\s*comment\\s*\\%\\}',
+ end: '\\{\\%\\s*endcomment\\s*\\%\\}'
+ },
+ {
+ className: 'template_comment',
+ begin: '\\{#', end: '#\\}'
+ },
+ {
+ className: 'template_tag',
+ begin: '\\{\\%', end: '\\%\\}',
+ lexems: [dhc.IDENT_RE],
+ keywords: {
+ 'comment': 1, 'endcomment': 1, 'load': 1,
+ 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1,
+ 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1,
+ 'endfor': 1, 'in': 1, 'ifnotequal': 1,
+ 'endifnotequal': 1, 'widthratio': 1, 'extends': 1,
+ 'include': 1, 'spaceless': 1, 'endspaceless': 1,
+ 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1,
+ 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1,
+ 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1,
+ 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1
+ },
+ contains: ['filter']
+ },
+ {
+ className: 'variable',
+ begin: '\\{\\{', end: '\\}\\}',
+ contains: ['filter']
+ },
+ {
+ className: 'filter',
+ begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true,
+ lexems: [dhc.IDENT_RE],
+ keywords: {
+ 'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1,
+ 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1,
+ 'striptags': 1, 'filesizeformat': 1, 'escape': 1,
+ 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1,
+ 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1,
+ 'floatformat': 1, 'capfirst': 1, 'pprint': 1,
+ 'divisibleby': 1, 'add': 1, 'make_list': 1,
+ 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1,
+ 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1,
+ 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1,
+ 'dictsortreversed': 1, 'default_if_none': 1,
+ 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1,
+ 'default': 1, 'truncatewords_html': 1, 'upper': 1,
+ 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1,
+ 'addslashes': 1, 'slugify': 1, 'first': 1
+ },
+ contains: ['argument']
+ },
+ {
+ className: 'argument',
+ begin: '"', end: '"'
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/html.js b/includes/js/dojox/highlight/languages/html.js
new file mode 100644
index 0000000..0a6cc46
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/html.js
@@ -0,0 +1,70 @@
+if(!dojo._hasResource["dojox.highlight.languages.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.html"] = true;
+dojo.provide("dojox.highlight.languages.html");
+
+dojo.require("dojox.highlight._base");
+dojo.require("dojox.highlight.languages.xml");
+
+(function(){
+ var HTML_TAGS = {
+ 'code': 1, 'kbd': 1, 'font': 1, 'noscript': 1, 'style': 1, 'img': 1,
+ 'title': 1, 'menu': 1, 'tt': 1, 'tr': 1, 'param': 1, 'li': 1, 'tfoot': 1,
+ 'th': 1, 'input': 1, 'td': 1, 'dl': 1, 'blockquote': 1, 'fieldset': 1,
+ 'big': 1, 'dd': 1, 'abbr': 1, 'optgroup': 1, 'dt': 1, 'button': 1,
+ 'isindex': 1, 'p': 1, 'small': 1, 'div': 1, 'dir': 1, 'em': 1, 'frame': 1,
+ 'meta': 1, 'sub': 1, 'bdo': 1, 'label': 1, 'acronym': 1, 'sup': 1,
+ 'body': 1, 'xml': 1, 'basefont': 1, 'base': 1, 'br': 1, 'address': 1,
+ 'strong': 1, 'legend': 1, 'ol': 1, 'script': 1, 'caption': 1, 's': 1,
+ 'col': 1, 'h2': 1, 'h3': 1, 'h1': 1, 'h6': 1, 'h4': 1, 'h5': 1, 'table': 1,
+ 'select': 1, 'noframes': 1, 'span': 1, 'area': 1, 'dfn': 1, 'strike': 1,
+ 'cite': 1, 'thead': 1, 'head': 1, 'option': 1, 'form': 1, 'hr': 1,
+ 'var': 1, 'link': 1, 'b': 1, 'colgroup': 1, 'ul': 1, 'applet': 1, 'del': 1,
+ 'iframe': 1, 'pre': 1, 'frameset': 1, 'ins': 1, 'tbody': 1, 'html': 1,
+ 'samp': 1, 'map': 1, 'object': 1, 'a': 1, 'xmlns': 1, 'center': 1,
+ 'textarea': 1, 'i': 1, 'q': 1, 'u': 1
+ };
+ var HTML_DOCTYPE = {
+ className: 'doctype',
+ begin: '',
+ relevance: 10
+ };
+ var HTML_ATTR = {
+ className: 'attribute',
+ begin: ' [a-zA-Z]+', end: '^'
+ };
+ var HTML_VALUE = {
+ className: 'value',
+ begin: '[a-zA-Z0-9]+', end: '^'
+ };
+
+ var dh = dojox.highlight, dhc = dh.constants, dhl = dh.languages, x = dhl.xml;
+ dhl.html = {
+ defaultMode: {
+ contains: ['tag', 'comment', 'doctype']
+ },
+ case_insensitive: true,
+ modes: [
+ x.XML_COMMENT,
+ HTML_DOCTYPE,
+ {
+ className: 'tag',
+ lexems: [dhc.IDENT_RE],
+ keywords: HTML_TAGS,
+ begin: '<[A-Za-z/]', end: '>',
+ contains: ['attribute'],
+ illegal: '[\\+\\.]'
+ },
+ x.XML_ATTR,
+ HTML_ATTR,
+ x.XML_VALUE,
+ HTML_VALUE
+ ],
+ // exporting constants
+ HTML_TAGS: HTML_TAGS,
+ HTML_DOCTYPE: HTML_DOCTYPE,
+ HTML_ATTR: HTML_ATTR,
+ HTML_VALUE: HTML_VALUE
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/javascript.js b/includes/js/dojox/highlight/languages/javascript.js
new file mode 100644
index 0000000..587cb07
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/javascript.js
@@ -0,0 +1,55 @@
+if(!dojo._hasResource["dojox.highlight.languages.javascript"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.javascript"] = true;
+dojo.provide("dojox.highlight.languages.javascript");
+
+dojo.require("dojox.highlight._base");
+
+(function(){
+ var dh = dojox.highlight, dhc = dh.constants;
+ dh.languages.javascript = {
+ defaultMode: {
+ lexems: [dhc.UNDERSCORE_IDENT_RE],
+ contains: ['string', 'comment', 'number', 'regexp', 'function'],
+ keywords: {
+ 'keyword': {
+ 'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1,
+ 'new': 1, 'function': 1, 'do': 1, 'return': 1, 'void': 1,
+ 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1,
+ 'throw': 1, 'case': 1, 'default': 1, 'try': 1, 'this': 1,
+ 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1
+ },
+ 'literal': {'true': 1, 'false': 1, 'null': 1}
+ }
+ },
+ modes: [
+ dhc.C_LINE_COMMENT_MODE,
+ dhc.C_BLOCK_COMMENT_MODE,
+ dhc.C_NUMBER_MODE,
+ dhc.APOS_STRING_MODE,
+ dhc.QUOTE_STRING_MODE,
+ dhc.BACKSLASH_ESCAPE,
+ {
+ className: 'regexp',
+ begin: '/.*?[^\\\\/]/[gim]*', end: '^'
+ },
+ {
+ className: 'function',
+ begin: 'function\\b', end: '{',
+ lexems: [dhc.UNDERSCORE_IDENT_RE],
+ keywords: {'function': 1},
+ contains: ['title', 'params']
+ },
+ {
+ className: 'title',
+ begin: dhc.UNDERSCORE_IDENT_RE, end: '^'
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ contains: ['string', 'comment']
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/pygments/_html.js b/includes/js/dojox/highlight/languages/pygments/_html.js
new file mode 100644
index 0000000..64b3bfa
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/pygments/_html.js
@@ -0,0 +1,25 @@
+if(!dojo._hasResource["dojox.highlight.languages.pygments._html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.pygments._html"] = true;
+dojo.provide("dojox.highlight.languages.pygments._html");
+
+// html-related constants
+
+dojox.highlight.languages.pygments._html.tags = {
+ "code": 1, "kbd": 1, "font": 1, "noscript": 1, "style": 1, "img": 1,
+ "title": 1, "menu": 1, "tt": 1, "tr": 1, "param": 1, "li": 1, "tfoot": 1,
+ "th": 1, "input": 1, "td": 1, "dl": 1, "blockquote": 1, "fieldset": 1,
+ "big": 1, "dd": 1, "abbr": 1, "optgroup": 1, "dt": 1, "button": 1,
+ "isindex": 1, "p": 1, "small": 1, "div": 1, "dir": 1, "em": 1, "frame": 1,
+ "meta": 1, "sub": 1, "bdo": 1, "label": 1, "acronym": 1, "sup": 1,
+ "body": 1, "xml": 1, "basefont": 1, "base": 1, "br": 1, "address": 1,
+ "strong": 1, "legend": 1, "ol": 1, "script": 1, "caption": 1, "s": 1,
+ "col": 1, "h2": 1, "h3": 1, "h1": 1, "h6": 1, "h4": 1, "h5": 1, "table": 1,
+ "select": 1, "noframes": 1, "span": 1, "area": 1, "dfn": 1, "strike": 1,
+ "cite": 1, "thead": 1, "head": 1, "option": 1, "form": 1, "hr": 1,
+ "var": 1, "link": 1, "b": 1, "colgroup": 1, "ul": 1, "applet": 1, "del": 1,
+ "iframe": 1, "pre": 1, "frameset": 1, "ins": 1, "tbody": 1, "html": 1,
+ "samp": 1, "map": 1, "object": 1, "a": 1, "xmlns": 1, "center": 1,
+ "textarea": 1, "i": 1, "q": 1, "u": 1
+};
+
+}
diff --git a/includes/js/dojox/highlight/languages/pygments/_www.js b/includes/js/dojox/highlight/languages/pygments/_www.js
new file mode 100644
index 0000000..648ed6e
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/pygments/_www.js
@@ -0,0 +1,12 @@
+if(!dojo._hasResource["dojox.highlight.languages.pygments._www"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.pygments._www"] = true;
+dojo.provide("dojox.highlight.languages.pygments._www");
+
+/* common web-centric languages */
+dojo.require("dojox.highlight.languages.pygments.xml");
+dojo.require("dojox.highlight.languages.pygments.html");
+dojo.require("dojox.highlight.languages.pygments.css");
+//dojo.require("dojox.highlight.languages.pygments.django");
+dojo.require("dojox.highlight.languages.pygments.javascript");
+
+}
diff --git a/includes/js/dojox/highlight/languages/pygments/css.js b/includes/js/dojox/highlight/languages/pygments/css.js
new file mode 100644
index 0000000..bfb0680
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/pygments/css.js
@@ -0,0 +1,211 @@
+if(!dojo._hasResource["dojox.highlight.languages.pygments.css"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.pygments.css"] = true;
+dojo.provide("dojox.highlight.languages.pygments.css");
+
+dojo.require("dojox.highlight._base");
+dojo.require("dojox.highlight.languages.pygments._html");
+
+(function(){
+ var dh = dojox.highlight, dhl = dh.languages;
+ dhl.css = {
+ defaultMode: {
+ lexems: ["\\b[a-zA-Z0-9]+\\b", "\\b@media\b"],
+ keywords: {
+ "keyword": {
+ "@media": 1
+ },
+ "name tag": dhl.pygments._html.tags
+ },
+ contains: [
+ "comment",
+ "string single", "string double",
+ "punctuation",
+ "name decorator", "name class", "name function",
+ "_content"
+ ]
+ },
+ modes: [
+ // comments
+ {
+ className: "comment",
+ begin: "/\\*", end: "\\*/",
+ relevance: 0
+ },
+ {
+ className: "comment preproc",
+ begin: "@[a-z][a-zA-Z]*", end: "^"
+ },
+ {
+ className: "comment preproc",
+ begin: "\\!important\\b", end: "^"
+ },
+
+ // numbers
+ {
+ className: "number",
+ begin: "\\#[a-fA-F0-9]{3}\\b", end: "^",
+ relevance: 0
+ },
+ {
+ className: "number",
+ begin: "\\#[a-fA-F0-9]{6}\\b", end: "^",
+ relevance: 0
+ },
+ {
+ className: "number",
+ begin: "[\\.\\-]?[0-9]*[\\.]?[0-9]+(em|px|\\%|pt|pc|in|mm|cm|ex)", end: "^",
+ relevance: 0
+ },
+ {
+ className: "number",
+ begin: "\\-?[0-9]+", end: "^",
+ relevance: 0
+ },
+
+ // strings
+ {
+ className: "string single",
+ begin: "'", end: "'",
+ illegal: "\\n",
+ relevance: 0
+ },
+ {
+ className: "string double",
+ begin: '"',
+ end: '"',
+ illegal: "\\n",
+ relevance: 0
+ },
+
+ // operators
+ {
+ className: "operator",
+ begin: "[~\\^\\*!%&\\[\\]\\(\\)<>\\|+=@:;,./?-]", end: "^",
+ relevance: 0
+ },
+
+ // punctuations
+ {
+ className: "punctuation",
+ begin: "[\\[\\]();]+", end: "^",
+ relevance: 0
+ },
+
+ // names
+ {
+ className: "name decorator",
+ begin: "\\:[a-zA-Z0-9_\\-]+\\b", end: "^"
+ },
+ {
+ className: "name class",
+ begin: "\\.[a-zA-Z0-9_\\-]+\\b", end: "^"
+ },
+ {
+ className: "name function",
+ begin: "\\#[a-zA-Z0-9_\\-]+\\b", end: "^"
+ },
+ {
+ className: "_content",
+ begin: "\\{", end: "\\}",
+ lexems: ["\\b[a-zA-Z\\-]+\\b"],
+ keywords: {
+ "keyword": {
+ "azimuth": 1, "background-attachment": 1, "background-color": 1,
+ "background-image": 1, "background-position": 1, "background-repeat": 1,
+ "background": 1, "border-bottom-color": 1, "border-bottom-style": 1,
+ "border-bottom-width": 1, "border-left-color": 1, "border-left-style": 1,
+ "border-left-width": 1, "border-right": 1, "border-right-color": 1,
+ "border-right-style": 1, "border-right-width": 1, "border-top-color": 1,
+ "border-top-style": 1, "border-top-width": 1, "border-bottom": 1,
+ "border-collapse": 1, "border-left": 1, "border-width": 1, "border-color": 1,
+ "border-spacing": 1, "border-style": 1, "border-top": 1, "border": 1, "caption-side": 1,
+ "clear": 1, "clip": 1, "color": 1, "content": 1, "counter-increment": 1, "counter-reset": 1,
+ "cue-after": 1, "cue-before": 1, "cue": 1, "cursor": 1, "direction": 1, "display": 1,
+ "elevation": 1, "empty-cells": 1, "float": 1, "font-family": 1, "font-size": 1,
+ "font-size-adjust": 1, "font-stretch": 1, "font-style": 1, "font-variant": 1,
+ "font-weight": 1, "font": 1, "height": 1, "letter-spacing": 1, "line-height": 1,
+ "list-style-type": 1, "list-style-image": 1, "list-style-position": 1,
+ "list-style": 1, "margin-bottom": 1, "margin-left": 1, "margin-right": 1,
+ "margin-top": 1, "margin": 1, "marker-offset": 1, "marks": 1, "max-height": 1, "max-width": 1,
+ "min-height": 1, "min-width": 1, "opacity": 1, "orphans": 1, "outline": 1, "outline-color": 1,
+ "outline-style": 1, "outline-width": 1, "overflow": 1, "padding-bottom": 1,
+ "padding-left": 1, "padding-right": 1, "padding-top": 1, "padding": 1, "page": 1,
+ "page-break-after": 1, "page-break-before": 1, "page-break-inside": 1,
+ "pause-after": 1, "pause-before": 1, "pause": 1, "pitch": 1, "pitch-range": 1,
+ "play-during": 1, "position": 1, "quotes": 1, "richness": 1, "right": 1, "size": 1,
+ "speak-header": 1, "speak-numeral": 1, "speak-punctuation": 1, "speak": 1,
+ "speech-rate": 1, "stress": 1, "table-layout": 1, "text-align": 1, "text-decoration": 1,
+ "text-indent": 1, "text-shadow": 1, "text-transform": 1, "top": 1, "unicode-bidi": 1,
+ "vertical-align": 1, "visibility": 1, "voice-family": 1, "volume": 1, "white-space": 1,
+ "widows": 1, "width": 1, "word-spacing": 1, "z-index": 1, "bottom": 1, "left": 1,
+ "above": 1, "absolute": 1, "always": 1, "armenian": 1, "aural": 1, "auto": 1, "avoid": 1, "baseline": 1,
+ "behind": 1, "below": 1, "bidi-override": 1, "blink": 1, "block": 1, "bold": 1, "bolder": 1, "both": 1,
+ "capitalize": 1, "center-left": 1, "center-right": 1, "center": 1, "circle": 1,
+ "cjk-ideographic": 1, "close-quote": 1, "collapse": 1, "condensed": 1, "continuous": 1,
+ "crop": 1, "crosshair": 1, "cross": 1, "cursive": 1, "dashed": 1, "decimal-leading-zero": 1,
+ "decimal": 1, "default": 1, "digits": 1, "disc": 1, "dotted": 1, "double": 1, "e-resize": 1, "embed": 1,
+ "extra-condensed": 1, "extra-expanded": 1, "expanded": 1, "fantasy": 1, "far-left": 1,
+ "far-right": 1, "faster": 1, "fast": 1, "fixed": 1, "georgian": 1, "groove": 1, "hebrew": 1, "help": 1,
+ "hidden": 1, "hide": 1, "higher": 1, "high": 1, "hiragana-iroha": 1, "hiragana": 1, "icon": 1,
+ "inherit": 1, "inline-table": 1, "inline": 1, "inset": 1, "inside": 1, "invert": 1, "italic": 1,
+ "justify": 1, "katakana-iroha": 1, "katakana": 1, "landscape": 1, "larger": 1, "large": 1,
+ "left-side": 1, "leftwards": 1, "level": 1, "lighter": 1, "line-through": 1, "list-item": 1,
+ "loud": 1, "lower-alpha": 1, "lower-greek": 1, "lower-roman": 1, "lowercase": 1, "ltr": 1,
+ "lower": 1, "low": 1, "medium": 1, "message-box": 1, "middle": 1, "mix": 1, "monospace": 1,
+ "n-resize": 1, "narrower": 1, "ne-resize": 1, "no-close-quote": 1, "no-open-quote": 1,
+ "no-repeat": 1, "none": 1, "normal": 1, "nowrap": 1, "nw-resize": 1, "oblique": 1, "once": 1,
+ "open-quote": 1, "outset": 1, "outside": 1, "overline": 1, "pointer": 1, "portrait": 1, "px": 1,
+ "relative": 1, "repeat-x": 1, "repeat-y": 1, "repeat": 1, "rgb": 1, "ridge": 1, "right-side": 1,
+ "rightwards": 1, "s-resize": 1, "sans-serif": 1, "scroll": 1, "se-resize": 1,
+ "semi-condensed": 1, "semi-expanded": 1, "separate": 1, "serif": 1, "show": 1, "silent": 1,
+ "slow": 1, "slower": 1, "small-caps": 1, "small-caption": 1, "smaller": 1, "soft": 1, "solid": 1,
+ "spell-out": 1, "square": 1, "static": 1, "status-bar": 1, "super": 1, "sw-resize": 1,
+ "table-caption": 1, "table-cell": 1, "table-column": 1, "table-column-group": 1,
+ "table-footer-group": 1, "table-header-group": 1, "table-row": 1,
+ "table-row-group": 1, "text": 1, "text-bottom": 1, "text-top": 1, "thick": 1, "thin": 1,
+ "transparent": 1, "ultra-condensed": 1, "ultra-expanded": 1, "underline": 1,
+ "upper-alpha": 1, "upper-latin": 1, "upper-roman": 1, "uppercase": 1, "url": 1,
+ "visible": 1, "w-resize": 1, "wait": 1, "wider": 1, "x-fast": 1, "x-high": 1, "x-large": 1, "x-loud": 1,
+ "x-low": 1, "x-small": 1, "x-soft": 1, "xx-large": 1, "xx-small": 1, "yes": 1
+ },
+ "name builtin": {
+ "indigo": 1, "gold": 1, "firebrick": 1, "indianred": 1, "yellow": 1, "darkolivegreen": 1,
+ "darkseagreen": 1, "mediumvioletred": 1, "mediumorchid": 1, "chartreuse": 1,
+ "mediumslateblue": 1, "black": 1, "springgreen": 1, "crimson": 1, "lightsalmon": 1, "brown": 1,
+ "turquoise": 1, "olivedrab": 1, "cyan": 1, "silver": 1, "skyblue": 1, "gray": 1, "darkturquoise": 1,
+ "goldenrod": 1, "darkgreen": 1, "darkviolet": 1, "darkgray": 1, "lightpink": 1, "teal": 1,
+ "darkmagenta": 1, "lightgoldenrodyellow": 1, "lavender": 1, "yellowgreen": 1, "thistle": 1,
+ "violet": 1, "navy": 1, "orchid": 1, "blue": 1, "ghostwhite": 1, "honeydew": 1, "cornflowerblue": 1,
+ "darkblue": 1, "darkkhaki": 1, "mediumpurple": 1, "cornsilk": 1, "red": 1, "bisque": 1, "slategray": 1,
+ "darkcyan": 1, "khaki": 1, "wheat": 1, "deepskyblue": 1, "darkred": 1, "steelblue": 1, "aliceblue": 1,
+ "gainsboro": 1, "mediumturquoise": 1, "floralwhite": 1, "coral": 1, "purple": 1, "lightgrey": 1,
+ "lightcyan": 1, "darksalmon": 1, "beige": 1, "azure": 1, "lightsteelblue": 1, "oldlace": 1,
+ "greenyellow": 1, "royalblue": 1, "lightseagreen": 1, "mistyrose": 1, "sienna": 1,
+ "lightcoral": 1, "orangered": 1, "navajowhite": 1, "lime": 1, "palegreen": 1, "burlywood": 1,
+ "seashell": 1, "mediumspringgreen": 1, "fuchsia": 1, "papayawhip": 1, "blanchedalmond": 1,
+ "peru": 1, "aquamarine": 1, "white": 1, "darkslategray": 1, "ivory": 1, "dodgerblue": 1,
+ "lemonchiffon": 1, "chocolate": 1, "orange": 1, "forestgreen": 1, "slateblue": 1, "olive": 1,
+ "mintcream": 1, "antiquewhite": 1, "darkorange": 1, "cadetblue": 1, "moccasin": 1,
+ "limegreen": 1, "saddlebrown": 1, "darkslateblue": 1, "lightskyblue": 1, "deeppink": 1,
+ "plum": 1, "aqua": 1, "darkgoldenrod": 1, "maroon": 1, "sandybrown": 1, "magenta": 1, "tan": 1,
+ "rosybrown": 1, "pink": 1, "lightblue": 1, "palevioletred": 1, "mediumseagreen": 1,
+ "dimgray": 1, "powderblue": 1, "seagreen": 1, "snow": 1, "mediumblue": 1, "midnightblue": 1,
+ "paleturquoise": 1, "palegoldenrod": 1, "whitesmoke": 1, "darkorchid": 1, "salmon": 1,
+ "lightslategray": 1, "lawngreen": 1, "lightgreen": 1, "tomato": 1, "hotpink": 1,
+ "lightyellow": 1, "lavenderblush": 1, "linen": 1, "mediumaquamarine": 1, "green": 1,
+ "blueviolet": 1, "peachpuff": 1
+ }
+ },
+ contains: [
+ "comment", "comment preproc",
+ "number",
+ "string single", "string double",
+ "punctuation",
+ "name decorator", "name class", "name function"
+ ]
+ }
+ ]
+ };
+})();
+
+}
diff --git a/includes/js/dojox/highlight/languages/pygments/html.js b/includes/js/dojox/highlight/languages/pygments/html.js
new file mode 100644
index 0000000..e0e7475
--- /dev/null
+++ b/includes/js/dojox/highlight/languages/pygments/html.js
@@ -0,0 +1,101 @@
+if(!dojo._hasResource["dojox.highlight.languages.pygments.html"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.highlight.languages.pygments.html"] = true;
+dojo.provide("dojox.highlight.languages.pygments.html");
+
+dojo.require("dojox.highlight._base");
+dojo.require("dojox.highlight.languages.pygments._html");
+
+(function(){
+ var dh = dojox.highlight, dhl = dh.languages, tags = [],
+ ht = dhl.pygments._html.tags;
+
+ for(var key in ht){
+ tags.push(key);
+ }
+ tags = "\\b(" + tags.join("|") + ")\\b";
+
+ dhl.html = {
+ case_insensitive: true,
+ defaultMode: {
+ contains: [
+ "name entity",
+ "comment", "comment preproc",
+ "_script", "_style", "_tag"
+ ]
+ },
+ modes: [
+ // comments
+ {
+ className: "comment",
+ begin: ""
+ },
+ {
+ className: "comment preproc",
+ begin: "\\<\\!\\[CDATA\\[", end: "\\]\\]\\>"
+ },
+ {
+ className: "comment preproc",
+ begin: "\\<\\!", end: "\\>"
+ },
+
+ // strings
+ {
+ className: "string",
+ begin: "'", end: "'",
+ illegal: "\\n",
+ relevance: 0
+ },
+ {
+ className: "string",
+ begin: '"',
+ end: '"',
+ illegal: "\\n",
+ relevance: 0
+ },
+
+ // names
+ {
+ className: "name entity",
+ begin: "\\&[a-z]+;", end: "^"
+ },
+ {
+ className: "name tag",
+ begin: tags, end: "^",
+ relevance: 5
+ },
+ {
+ className: "name attribute",
+ begin: "\\b[a-z0-9_\\:\\-]+\\s*=", end: "^",
+ relevance: 0
+ },
+
+ {
+ className: "_script",
+ begin: "\\
+
+
+
+
+
+
+client-side syntax highlighting for a number of languages.
+ +NOTE: All languages listed here have working language definitions, though +not all exist in the release or dojo subversion. The missing packs are not publically available. +
+ + +Some Python code:
+ +@requires_authorization
+def somefunc(param1, param2):
+ '''A docstring'''
+ if param1 > param2: # interesting
+ print 'Gre\'ater'
+ print ''
+ return param2 - param1 + 1
+
+class SomeClass:
pass
+
+
+
+
+
+A chunk of PHP:
+ +
+$opAr = array ( "-a|--append", // a or append toggle, nothing extra
+ "-i|--input:", // i or input with next input being needed
+ "-l|--list:", // l with input needed
+ //"--foo", // broken
+ "-f:", // f with no input
+ "--wot:" // wot with input, no short
+ );
+
+
+$op = bgetop($opAr);
+if (is_array($op)) { print_r($op); }
+
+/* here is the code: */
+
+function bgetop($opAr=array(),$unknown=true) {
+
+$argv = $_SERVER['argv'];
+$argc = $_SERVER['argc'];
+$argPos = 1; // zero is program running
+
+// foreach arg
+while ($argPos<$argc) {
+ $arg = $argv[$argPos];
+ if ($arg{0}=="-") {
+ if ($arg{1}=="-") {
+ $var = substr($arg,2,strlen($arg));
+ } else { $var = $arg{1}; }
+ foreach ($opAr as $opk => $opv) {
+ if (!isset($return[$var])) {
+ if (strpos($opv,$arg) !== FALSE) {
+ // this is where the -f -foo fix needs to be,
+ // the partial string exists in this record,
+ // but we need to determine if it's accurate
+ // somehow (i'm thinking: eregi?)
+ if ($accurate=1) {
+ // we foudn the key
+ if (strpos($opv,':') !== FALSE) {
+ // next value is the one to use,
+ // then skip it in the parser.
+ if (isset($argv[$argPos+1])) {
+ $return[$var] = $argv[++$argPos];
+ } else {
+ $return[$var] = FALSE;
+ }
+ } else {
+ // just set the toggle
+ $return[$var] = TRUE;
+ }
+ // don't check this opAr value again
+ unset($opAr[$opk]);
+ }
+ } // if accurate
+ } // !isset already
+ } // foreach opAr
+ } else { // we weren't expecting a non-hyphened argument, possibly just a filename, or whatnot
+ if ($unknown) { $return['unknown'][]=$arg; }
+ }
+ $argPos++;
+} // while argPos < argc
+
+if (is_array($return)) {
+return $return;
+} else { return 0; }
+
+} // end function bgetop
+
+
+
+A custom XML document:
+ +<?xml version="1.0"?>
+<response value="ok">
+ <text>Ok</text>
+ <comment/>
+ <ns:description><![CDATA[
+ CDATA is <not> magical.
+ ]]></ns:description>
+</response>
+
+
+Some HTML code:
+ +<head>
+ <title>Title</title>
+<body>
+ <p class="something">Something</p>
+ <p class=something>Something</p>
+ <!-- comment -->
+ <p class>Something</p>
+ <p class="something" title="p">Something</p>
+</body>
+
+
+HTML with Django templates:
+ +{% if articles|length %}
+{% for article in articles %}
+
+{# Striped table #}
+<tr class="{% cycle odd,even %}">
+ <td>{{ article|default:"Hi... "|escape }}</td>
+ <td>{{ article.date|date:"d.m.Y" }}</td>
+</tr>
+
+{% endfor %}
+{% endif %}
+
+{% comment %}
+Comments may be long and
+multiline.
+{% endcomment %}
+
+
+Some CSS code:
+ +body,
+html {
+ font: Tahoma, Arial, san-serif;
+}
+
+#content {
+ width: 100%; /* css comment */
+ height: 100%
+}
+
+p[lang=ru] {
+ color: red;
+}
+
+
+Explicit Python highlight:
+ +for x in [1, 2, 3]:
+ count(x)
+
+
+Disabled highlighting:
+ +<div id="contents">
+ <p>Hello, World!
+</div>
+
+
+Normal dojo-looking code
+ +
+dojo.provide("some.object");
+dojo.declare("some.object",null,{
+ param: "value",
+ _myMethod: function(/* Event */e){
+ this.inherited(arguments);
+ },
+ // comments
+ _another: function(){
+ dojo.addClass("foo","hovered");
+ }
+});
+dojo.addOnLoad(function(){
+ //
+ // comments with <HTML> inline
+ var d = dojo;
+ d.mixin(d,{
+ foo: function(e){
+ d.bar(e);
+ },
+ bar: function(e){
+ alert(e);
+ }
+ });
+});
+
+
+Lazy, xhr'd code:
+ +
+
+Text with inlined JavaScript code: dojo.forEach(a, function(x){ console.log(x); });
— that was the inlined sample.
Markuped code (python), no language was specified:
+ +@requires_authorization
+def somefunc(param1, param2):
+ '''A docstring'''
+ if param1 > param2: # interesting
+ print 'Gre\'ater'
+ print ''
+ return param2 - param1 + 1
+
+class SomeClass:
pass
+
+
+Markuped code, "python" was specified:
+ +@requires_authorization
+def somefunc(param1, param2):
+ '''A docstring'''
+ if param1 > param2: # interesting
+ print 'Gre\'ater'
+ print ''
+ return param2 - param1 + 1
+
+class SomeClass:
pass
+
+
+
+
diff --git a/includes/js/dojox/highlight/tests/test_pygments.html b/includes/js/dojox/highlight/tests/test_pygments.html
new file mode 100644
index 0000000..6bdced6
--- /dev/null
+++ b/includes/js/dojox/highlight/tests/test_pygments.html
@@ -0,0 +1,142 @@
+
+
+
+ Current theme from the pygments set: + +
+ +Javascript:
+ +function initHighlight(block) {
+ if (block.className.search(/\bno\-highlight\b/) != -1)
+ return false;
+ try {
+ blockText(block);
+ } catch (e) {
+ if (e == 'Complex markup')
+ return;
+ }//try
+ var classes = block.className.split(/\s+/);
+ for (var i = 0; i < classes.length; i++) {
+ if (LANGUAGES[classes[i]]) {
+ highlightLanguage(block, classes[i]);
+ return;
+ }//if
+ }//for
+ highlightAuto(block);
+}//initHighlight
+
+Some CSS code:
+ +body,
+html {
+ font: Tahoma, Arial, sans-serif;
+}
+
+#content {
+ width: 100%; /* test comment */
+ height: 100%
+}
+
+p[lang=ru] {
+ color: red;
+}
+
+
+Some HTML code:
+ +<head>
+ <title>Title</title>
+<body>
+ <p class="something">Something</p>
+ <p class=something>Something</p>
+ <!-- comment -->
+ <p class>Something</p>
+ <p class="something" title="p">Something</p>
+</body>
+
+
+A custom XML document:
+ +<?xml version="1.0"?>
+<response value="ok">
+ <text>Ok</text>
+ <comment/>
+ <ns:description><![CDATA[
+ CDATA is <not> magical.
+ ]]></ns:description>
+</response>
+
+
+
+
--
cgit v1.2.3-54-g00ecf