diff --git a/api/classes/CLI.html b/api/classes/CLI.html index 07c9e470..6edd7a57 100644 --- a/api/classes/CLI.html +++ b/api/classes/CLI.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30
diff --git a/api/classes/DocBuilder.html b/api/classes/DocBuilder.html index 8399330f..c5556681 100644 --- a/api/classes/DocBuilder.html +++ b/api/classes/DocBuilder.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/DocParser.html b/api/classes/DocParser.html index 3d746587..7213f1bc 100644 --- a/api/classes/DocParser.html +++ b/api/classes/DocParser.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/DocView.html b/api/classes/DocView.html index 91180235..486d854e 100644 --- a/api/classes/DocView.html +++ b/api/classes/DocView.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/Files.html b/api/classes/Files.html index f2f49c8f..51ec5276 100644 --- a/api/classes/Files.html +++ b/api/classes/Files.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/Help.html b/api/classes/Help.html index 6e4f4316..a71de0cb 100644 --- a/api/classes/Help.html +++ b/api/classes/Help.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -238,7 +238,7 @@

renderHelp

- lib/help.js:58 + lib/help.js:59

@@ -305,7 +305,7 @@

showHelp

- lib/help.js:68 + lib/help.js:69

diff --git a/api/classes/Main.html b/api/classes/Main.html index b3c23445..6aacd803 100644 --- a/api/classes/Main.html +++ b/api/classes/Main.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/Options.html b/api/classes/Options.html index 0cc8f11e..2ce683f2 100644 --- a/api/classes/Options.html +++ b/api/classes/Options.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/Server.html b/api/classes/Server.html index 57b4fcc7..b78cec87 100644 --- a/api/classes/Server.html +++ b/api/classes/Server.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/classes/Utils.html b/api/classes/Utils.html index 64b8c990..9e221d9b 100644 --- a/api/classes/Utils.html +++ b/api/classes/Utils.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -294,7 +294,7 @@

escapeHTML

- lib/utils.js:29 + lib/utils.js:31

@@ -398,7 +398,7 @@

fixType

- lib/utils.js:405 + lib/utils.js:407

@@ -502,7 +502,7 @@

getDirs

- lib/utils.js:309 + lib/utils.js:311

@@ -606,7 +606,7 @@

getLayouts

- lib/utils.js:63 + lib/utils.js:65

@@ -711,7 +711,7 @@

getPage

- lib/utils.js:76 + lib/utils.js:78

@@ -815,7 +815,7 @@

getPages

- lib/utils.js:89 + lib/utils.js:91

@@ -921,7 +921,7 @@

getPartials

- lib/utils.js:120 + lib/utils.js:122

@@ -1022,7 +1022,7 @@

getProjectData

- lib/utils.js:223 + lib/utils.js:225

@@ -1122,7 +1122,7 @@

prepare

- lib/utils.js:134 + lib/utils.js:136

@@ -1275,7 +1275,7 @@

unindent

- lib/utils.js:42 + lib/utils.js:44

@@ -1384,7 +1384,7 @@

validatePaths

- lib/utils.js:336 + lib/utils.js:338

diff --git a/api/classes/YUIDoc.html b/api/classes/YUIDoc.html index 40117c3a..011e73ee 100644 --- a/api/classes/YUIDoc.html +++ b/api/classes/YUIDoc.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/data.json b/api/data.json index c070b1b4..5bfb74bc 100644 --- a/api/data.json +++ b/api/data.json @@ -3,7 +3,7 @@ "name": "YUIDoc", "logo": "http://yuilibrary.com/img/yui-logo.png", "description": "YUIDoc, YUI's JavaScript Documentation engine.", - "version": "0.3.29" + "version": "0.3.30" }, "files": { "lib/builder.js": { @@ -1724,7 +1724,7 @@ }, { "file": "lib/help.js", - "line": 58, + "line": 59, "description": "Render the help message as a string", "itemtype": "method", "name": "renderHelp", @@ -1737,7 +1737,7 @@ }, { "file": "lib/help.js", - "line": 68, + "line": 69, "description": "Display the help message, write it to the screen and exit", "itemtype": "method", "name": "showHelp", @@ -1922,7 +1922,7 @@ }, { "file": "lib/utils.js", - "line": 29, + "line": 31, "description": "Escapes HTML characters in _html_.", "itemtype": "method", "name": "escapeHTML", @@ -1942,7 +1942,7 @@ }, { "file": "lib/utils.js", - "line": 42, + "line": 44, "description": "Normalizes the initial indentation of the given _content_ so that the first line\nis unindented, and all other lines are unindented to the same degree as the\nfirst line. So if the first line has four spaces at the beginning, then all\nlines will be unindented four spaces.", "itemtype": "method", "name": "unindent", @@ -1964,7 +1964,7 @@ }, { "file": "lib/utils.js", - "line": 63, + "line": 65, "description": "Like `getPages()`, but returns only the files under the `layout/` subdirectory\nof the specified _dir_.", "itemtype": "method", "name": "getLayouts", @@ -1984,7 +1984,7 @@ }, { "file": "lib/utils.js", - "line": 76, + "line": 78, "description": "Loads and returns the content of the specified page file.", "itemtype": "method", "name": "getPage", @@ -2004,7 +2004,7 @@ }, { "file": "lib/utils.js", - "line": 89, + "line": 91, "description": "Loads pages (files with a `.handlebars` extension) in the specified directory and\nreturns an object containing a mapping of page names (the part of the filename)\npreceding the `.handlebars` extension) to page content.", "itemtype": "method", "name": "getPages", @@ -2024,7 +2024,7 @@ }, { "file": "lib/utils.js", - "line": 120, + "line": 122, "description": "Like `getPages()`, but returns only the files under the `partial/` subdirectory\nof the specified _dir_.", "itemtype": "method", "name": "getPartials", @@ -2044,7 +2044,7 @@ }, { "file": "lib/utils.js", - "line": 134, + "line": 136, "description": "Mix/merge/munge data into the template.", "itemtype": "method", "name": "prepare", @@ -2082,7 +2082,7 @@ }, { "file": "lib/utils.js", - "line": 223, + "line": 225, "description": "Walk the directory tree to locate the yuidoc.json file.", "itemtype": "method", "name": "getProjectData", @@ -2100,7 +2100,7 @@ }, { "file": "lib/utils.js", - "line": 309, + "line": 311, "description": "Walks the tree from this dir and returns all the subdirs", "itemtype": "method", "name": "getDirs", @@ -2120,7 +2120,7 @@ }, { "file": "lib/utils.js", - "line": 336, + "line": 338, "description": "Make sure all the paths passed are directories and that they are not in the ignore list.", "itemtype": "method", "name": "validatePaths", @@ -2143,7 +2143,7 @@ }, { "file": "lib/utils.js", - "line": 405, + "line": 407, "description": "Takes a type string and converts it to a \"First letter upper cased\" type. e.g. `(string -> String, object -> Object)`", "itemtype": "method", "name": "fixType", diff --git a/api/files/lib_builder.js.html b/api/files/lib_builder.js.html index 42620458..f357b066 100644 --- a/api/files/lib_builder.js.html +++ b/api/files/lib_builder.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -1564,7 +1564,7 @@

File: lib/builder.js

opts = self.populateFiles(opts); opts.meta.fileName = data.name; - fs.readFile(opts.meta.fileName, 'utf8', Y.rbind(function(err, str, opts, data) { + fs.readFile(opts.meta.fileName, Y.charset, Y.rbind(function(err, str, opts, data) { if (err) { Y.log(err, 'error', 'builder'); cb(err); @@ -1592,7 +1592,7 @@

File: lib/builder.js

Y.log('Writing API Meta Data', 'info', 'builder'); var self = this; this.renderAPIMeta(function(js) { - fs.writeFile(path.join(self.options.outdir, 'api.js'), js, 'utf8', cb); + fs.writeFile(path.join(self.options.outdir, 'api.js'), js, Y.charset, cb); }); }, /** diff --git a/api/files/lib_cli.js.html b/api/files/lib_cli.js.html index 06f4e14e..2406859c 100644 --- a/api/files/lib_cli.js.html +++ b/api/files/lib_cli.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/files/lib_docparser.js.html b/api/files/lib_docparser.js.html index 168ab3a0..381b3c71 100644 --- a/api/files/lib_docparser.js.html +++ b/api/files/lib_docparser.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/files/lib_docview.js.html b/api/files/lib_docview.js.html index dcfb2909..8af720cd 100644 --- a/api/files/lib_docview.js.html +++ b/api/files/lib_docview.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/files/lib_files.js.html b/api/files/lib_files.js.html index 8a4aed4b..9b9d34bd 100644 --- a/api/files/lib_files.js.html +++ b/api/files/lib_files.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -500,7 +500,7 @@

File: lib/files.js

Y.Files.getJSON = function(filename) { var data = {}; if (exists(filename)) { - data = JSON.parse(fs.readFileSync(filename, "utf8")); + data = JSON.parse(fs.readFileSync(filename, 'utf8')); }; return data; }; @@ -518,7 +518,7 @@

File: lib/files.js

var writeFile = function(file, data, cb) { var flags = { - flags: "w", encoding: "utf8", mode: 0644 + flags: "w", encoding: Y.charset, mode: 0644 } var args = arguments; if (cb) { diff --git a/api/files/lib_help.js.html b/api/files/lib_help.js.html index 277f5f44..3dad885f 100644 --- a/api/files/lib_help.js.html +++ b/api/files/lib_help.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -155,6 +155,7 @@

File: lib/help.js

" -o, --out <directory path> Path to put the generated files (defaults to ./out)", " -t, --themedir <directory path> Path to a custom theme directory containing Handlebars templates", " -H, --helpers <comma separated list of paths to files> Require these file and add Handlebars helpers. See docs for more information", + " --charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8'", " -h, --help Show this help", " -q, --quiet Supress logging output", " -T, --theme <simple|default> Choose one of the built in themes (default is default)", diff --git a/api/files/lib_index.js.html b/api/files/lib_index.js.html index 2620a9a5..386285db 100644 --- a/api/files/lib_index.js.html +++ b/api/files/lib_index.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/files/lib_options.js.html b/api/files/lib_options.js.html index 01b0c376..d5b928f8 100644 --- a/api/files/lib_options.js.html +++ b/api/files/lib_options.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -138,6 +138,10 @@

File: lib/options.js

case "--debug": Y.applyConfig({ debug: true, filter: 'debug' }); break; + case "--charset": + Y.charset = args.shift() || 'utf8'; + Y.log('Setting default charset to ' + Y.charset, 'yuidoc', 'warn'); + break; case "-c": case "--config": case "--configfile": diff --git a/api/files/lib_server.js.html b/api/files/lib_server.js.html index 9781528e..67a4dff8 100644 --- a/api/files/lib_server.js.html +++ b/api/files/lib_server.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/files/lib_utils.js.html b/api/files/lib_utils.js.html index e4559bbc..bc8263b2 100644 --- a/api/files/lib_utils.js.html +++ b/api/files/lib_utils.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -125,7 +125,9 @@

File: lib/utils.js

*/ YUI.add('utils', function(Y) { - + + Y.charset = 'utf8'; + var HTML_CHARS = { '&': '&amp;', '<': '&lt;', @@ -192,7 +194,7 @@

File: lib/utils.js

**/ function getPage(pagePath) { if (!Y.Files.isFile(pagePath)) { return null; } - return fs.readFileSync(pagePath, 'utf8'); + return fs.readFileSync(pagePath, Y.charset); } Y.getPage = getPage; @@ -218,7 +220,7 @@

File: lib/utils.js

var filePath = path.join(dir, filename); if (path.extname(filename) === '.handlebars' && Y.Files.isFile(filePath)) { - pages[path.basename(filename, '.handlebars')] = fs.readFileSync(filePath, 'utf8'); + pages[path.basename(filename, '.handlebars')] = fs.readFileSync(filePath, Y.charset); } }); cache[dir] = pages; diff --git a/api/files/lib_yuidoc.js.html b/api/files/lib_yuidoc.js.html index 4759a2bb..cdc32a8e 100644 --- a/api/files/lib_yuidoc.js.html +++ b/api/files/lib_yuidoc.js.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

@@ -308,7 +308,7 @@

File: lib/yuidoc.js

if (Y.Files.exists(fullpath)) { self.filecount++; - text = fs.readFileSync(fullpath, "utf8"); + text = fs.readFileSync(fullpath, Y.charset); self.filemap[fullpath] = text; self.dirmap[fullpath] = dir; @@ -394,7 +394,7 @@

File: lib/yuidoc.js

} out = fs.createWriteStream(file, { - flags: "w", encoding: "utf8", mode: 0644 + flags: "w", encoding: Y.charset, mode: 0644 }); out.write(JSON.stringify(data, null, 4)); out.end(); diff --git a/api/index.html b/api/index.html index 65fa670f..e8f3f602 100644 --- a/api/index.html +++ b/api/index.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/api/modules/yuidoc.html b/api/modules/yuidoc.html index 39fbd967..7dc51678 100644 --- a/api/modules/yuidoc.html +++ b/api/modules/yuidoc.html @@ -19,7 +19,7 @@

- API Docs for: 0.3.29 + API Docs for: 0.3.30

diff --git a/args/index.html b/args/index.html index bf0f8dfc..d197adcd 100644 --- a/args/index.html +++ b/args/index.html @@ -45,7 +45,7 @@

Running YUIDoc on the Command Line

YUI Doc generates API documentation from a modified JavaDoc syntax.
 
-Current version (0.3.29)
+Current version (0.3.30)
 
 Usage: yuidoc <options> <input path>
 
@@ -69,6 +69,7 @@ 

Running YUIDoc on the Command Line

-o, --out <directory path> Path to put the generated files (defaults to ./out) -t, --themedir <directory path> Path to a custom theme directory containing Handlebars templates -H, --helpers <comma separated list of paths to files> Require these file and add Handlebars helpers. See docs for more information + --charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8' -h, --help Show this help -q, --quiet Supress logging output -T, --theme <simple|default> Choose one of the built in themes (default is default) diff --git a/assets/vendor/prettify/prettify-min.js b/assets/vendor/prettify/prettify-min.js index 4845d05d..30955051 100644 --- a/assets/vendor/prettify/prettify-min.js +++ b/assets/vendor/prettify/prettify-min.js @@ -1 +1,2 @@ -window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); +egisterLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); \ No newline at end of file diff --git a/assets/vendor/prettify/prettify.js b/assets/vendor/prettify/prettify.js index 63d73d0a..f54e943a 100644 --- a/assets/vendor/prettify/prettify.js +++ b/assets/vendor/prettify/prettify.js @@ -56,7 +56,7 @@ */ // JSLint declarations -/*global console, document, navigator, setTimeout, window, define */ +/*global console, document, navigator, setTimeout, window */ /** * Split {@code prettyPrint} into multiple timeouts so as not to interfere with @@ -65,30 +65,12 @@ */ window['PR_SHOULD_USE_CONTINUATION'] = true; -/** - * Find all the {@code
} and {@code } tags in the DOM with
- * {@code class=prettyprint} and prettify them.
- *
- * @param {Function?} opt_whenDone if specified, called when the last entry
- *     has been finished.
- */
-var prettyPrintOne;
-/**
- * Pretty print a chunk of code.
- *
- * @param {string} sourceCodeHtml code as html
- * @return {string} code as html, but prettier
- */
-var prettyPrint;
-
-
 (function () {
-  var win = window;
   // Keyword lists for various languages.
   // We use things that coerce to strings to make them compact when minified
   // and to defeat aggressive optimizers that fold large string constants.
   var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
-  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + 
+  var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
       "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
       "static,struct,switch,typedef,union,unsigned,void,volatile"];
   var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
@@ -104,13 +86,12 @@ var prettyPrint;
       "transient"];
   var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
       "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
-      "fixed,foreach,from,group,implicit,in,interface,internal,into,is,let," +
-      "lock,object,out,override,orderby,params,partial,readonly,ref,sbyte," +
-      "sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort," +
-      "var,virtual,where"];
+      "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
+      "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
+      "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
   var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
       "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
-      "throw,true,try,unless,until,when,while,yes";
+      "true,try,unless,until,when,while,yes";
   var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
       "debugger,eval,export,function,get,null,set,undefined,var,with," +
       "Infinity,NaN"];
@@ -130,7 +111,7 @@ var prettyPrint;
   var ALL_KEYWORDS = [
       CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
       PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
-  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;
+  var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
 
   // token style names.  correspond to css classes
   /**
@@ -164,7 +145,7 @@ var prettyPrint;
    */
   var PR_PUNCTUATION = 'pun';
   /**
-   * token style for plain text.
+   * token style for a punctuation string.
    * @const
    */
   var PR_PLAIN = 'pln';
@@ -216,14 +197,14 @@ var prettyPrint;
  * "in" keyword since it's not a keyword in many languages, and might be used
  * as a count of inches.
  *
- * 

The link above does not accurately describe EcmaScript rules since + *

The link a above does not accurately describe EcmaScript rules since * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works * very well in practice. * * @private * @const */ -var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*'; +var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*'; // CAVEAT: this does not properly handle the case where a regular // expression immediately follows another since a regular expression may @@ -242,7 +223,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ */ function combinePrefixPatterns(regexs) { var capturedGroupIndex = 0; - + var needToFoldCase = false; var ignoreCase = false; for (var i = 0, n = regexs.length; i < n; ++i) { @@ -256,7 +237,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ break; } } - + var escapeCharToCodeUnit = { 'b': 8, 't': 9, @@ -265,7 +246,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ 'f': 0xc, 'r': 0xd }; - + function decodeEscape(charsetPart) { var cc0 = charsetPart.charCodeAt(0); if (cc0 !== 92 /* \\ */) { @@ -283,16 +264,18 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ return charsetPart.charCodeAt(1); } } - + function encodeEscape(charCode) { if (charCode < 0x20) { return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16); } var ch = String.fromCharCode(charCode); - return (ch === '\\' || ch === '-' || ch === ']' || ch === '^') - ? "\\" + ch : ch; + if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') { + ch = '\\' + ch; + } + return ch; } - + function caseFoldCharset(charSet) { var charsetParts = charSet.substring(1, charSet.length - 1).match( new RegExp( @@ -304,16 +287,13 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ + '|-' + '|[^-\\\\]', 'g')); + var groups = []; var ranges = []; var inverse = charsetParts[0] === '^'; - - var out = ['[']; - if (inverse) { out.push('^'); } - for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) { var p = charsetParts[i]; if (/\\[bdsw]/i.test(p)) { // Don't muck with named groups. - out.push(p); + groups.push(p); } else { var start = decodeEscape(p); var end; @@ -338,12 +318,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } } } - + // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]] // -> [[1, 12], [14, 14], [16, 17]] ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); }); var consolidatedRanges = []; - var lastRange = []; + var lastRange = [NaN, NaN]; for (var i = 0; i < ranges.length; ++i) { var range = ranges[i]; if (range[0] <= lastRange[1] + 1) { @@ -352,7 +332,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ consolidatedRanges.push(lastRange = range); } } - + + var out = ['[']; + if (inverse) { out.push('^'); } + out.push.apply(out, groups); for (var i = 0; i < consolidatedRanges.length; ++i) { var range = consolidatedRanges[i]; out.push(encodeEscape(range[0])); @@ -364,7 +347,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ out.push(']'); return out.join(''); } - + function allowAnywhereFoldCaseAndRenumberGroups(regex) { // Split into character sets, escape sequences, punctuation strings // like ('(', '(?:', ')', '^'), and runs of characters that do not @@ -378,17 +361,17 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ + '|\\\\[0-9]+' // a back-reference or octal escape + '|\\\\[^ux0-9]' // other escape sequence + '|\\(\\?[:!=]' // start of a non-capturing group - + '|[\\(\\)\\^]' // start/end of a group, or line start + + '|[\\(\\)\\^]' // start/emd of a group, or line start + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters + ')', 'g')); var n = parts.length; - + // Maps captured group numbers to the number they will occupy in // the output or to -1 if that has not been determined, or to // undefined if they need not be capturing in the output. var capturedGroups = []; - + // Walk over and identify back references to build the capturedGroups // mapping. for (var i = 0, groupIndex = 0; i < n; ++i) { @@ -398,19 +381,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ ++groupIndex; } else if ('\\' === p.charAt(0)) { var decimalValue = +p.substring(1); - if (decimalValue) { - if (decimalValue <= groupIndex) { - capturedGroups[decimalValue] = -1; - } else { - // Replace with an unambiguous escape sequence so that - // an octal escape sequence does not turn into a backreference - // to a capturing group from an earlier regex. - parts[i] = encodeEscape(decimalValue); - } + if (decimalValue && decimalValue <= groupIndex) { + capturedGroups[decimalValue] = -1; } } } - + // Renumber groups and reduce capturing groups to non-capturing groups // where possible. for (var i = 1; i < capturedGroups.length; ++i) { @@ -422,23 +398,23 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ var p = parts[i]; if (p === '(') { ++groupIndex; - if (!capturedGroups[groupIndex]) { + if (capturedGroups[groupIndex] === undefined) { parts[i] = '(?:'; } } else if ('\\' === p.charAt(0)) { var decimalValue = +p.substring(1); if (decimalValue && decimalValue <= groupIndex) { - parts[i] = '\\' + capturedGroups[decimalValue]; + parts[i] = '\\' + capturedGroups[groupIndex]; } } } - + // Remove any prefix anchors so that the output will match anywhere. // ^^ really does mean an anchored match though. - for (var i = 0; i < n; ++i) { + for (var i = 0, groupIndex = 0; i < n; ++i) { if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; } } - + // Expand letters to groups to handle mixing of case-sensitive and // case-insensitive patterns if necessary. if (regex.ignoreCase && needToFoldCase) { @@ -458,10 +434,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } } } - + return parts.join(''); } - + var rewritten = []; for (var i = 0, n = regexs.length; i < n; ++i) { var regex = regexs[i]; @@ -469,7 +445,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ rewritten.push( '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')'); } - + return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g'); } @@ -497,8 +473,8 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ *

    * {
    *   sourceCode: "print 'Hello '\n  + 'World';",
-   *   //                     1          2
-   *   //           012345678901234 5678901234567
+   *   //                 1         2
+   *   //       012345678901234 5678901234567
    *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
    * }
    * 
@@ -515,18 +491,25 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ *

* * @param {Node} node an HTML DOM subtree containing source-code. - * @param {boolean} isPreformatted true if white-space in text nodes should - * be considered significant. * @return {Object} source code and the text nodes in which they occur. */ - function extractSourceSpans(node, isPreformatted) { + function extractSourceSpans(node) { var nocode = /(?:^|\s)nocode(?:\s|$)/; - + var chunks = []; var length = 0; var spans = []; var k = 0; - + + var whitespace; + if (node.currentStyle) { + whitespace = node.currentStyle.whiteSpace; + } else if (window.getComputedStyle) { + whitespace = document.defaultView.getComputedStyle(node, null) + .getPropertyValue('white-space'); + } + var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3); + function walk(node) { switch (node.nodeType) { case 1: // Element @@ -534,8 +517,8 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ for (var child = node.firstChild; child; child = child.nextSibling) { walk(child); } - var nodeName = node.nodeName.toLowerCase(); - if ('br' === nodeName || 'li' === nodeName) { + var nodeName = node.nodeName; + if ('BR' === nodeName || 'LI' === nodeName) { chunks[k] = '\n'; spans[k << 1] = length++; spans[(k++ << 1) | 1] = node; @@ -558,9 +541,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ break; } } - + walk(node); - + return { sourceCode: chunks.join('').replace(/\n$/, ''), spans: spans @@ -832,13 +815,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } else { // Stop C preprocessor declarations at an unclosed open comment shortcutStylePatterns.push( - [PR_COMMENT, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/, + [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, '#']); } - // #include fallthroughStylePatterns.push( [PR_STRING, - /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/, + /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, null]); } else { shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']); @@ -886,45 +868,6 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } shortcutStylePatterns.push([PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0']); - - var punctuation = - // The Bash man page says - - // A word is a sequence of characters considered as a single - // unit by GRUB. Words are separated by metacharacters, - // which are the following plus space, tab, and newline: { } - // | & $ ; < > - // ... - - // A word beginning with # causes that word and all remaining - // characters on that line to be ignored. - - // which means that only a '#' after /(?:^|[{}|&$;<>\s])/ starts a - // comment but empirically - // $ echo {#} - // {#} - // $ echo \$# - // $# - // $ echo }# - // }# - - // so /(?:^|[|&;<>\s])/ is more appropriate. - - // http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC3 - // suggests that this definition is compatible with a - // default mode that tries to use a single token definition - // to recognize both bash/python style comments and C - // preprocessor directives. - - // This definition of punctuation does not include # in the list of - // follow-on exclusions, so # will not be broken before if preceeded - // by a punctuation character. We could try to exclude # after - // [|&;<>] but that doesn't seem to cause many major problems. - // If that does turn out to be a problem, we should change the below - // when hc is truthy to include # in the run of punctuation characters - // only when not followint [|&;<>]. - /^.[^\s\w\.$@\'\"\`\/\\]*/; - fallthroughStylePatterns.push( // TODO(mikesamuel): recognize non-latin letters and numerals in idents [PR_LITERAL, /^@[a-z_$][a-z_$@0-9]*/i, null], @@ -945,7 +888,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ null, '0123456789'], // Don't treat escaped quotes in bash as starting strings. See issue 144. [PR_PLAIN, /^\\[\s\S]?/, null], - [PR_PUNCTUATION, punctuation, null]); + [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]); return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns); } @@ -966,28 +909,37 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ * HTMLOListElement, and each line is moved into a separate list item. * This requires cloning elements, so the input might not have unique * IDs after numbering. - * @param {boolean} isPreformatted true iff white-space in text nodes should - * be treated as significant. */ - function numberLines(node, opt_startLineNum, isPreformatted) { + function numberLines(node, opt_startLineNum) { var nocode = /(?:^|\s)nocode(?:\s|$)/; var lineBreak = /\r\n?|\n/; - + var document = node.ownerDocument; - - var li = document.createElement('li'); + + var whitespace; + if (node.currentStyle) { + whitespace = node.currentStyle.whiteSpace; + } else if (window.getComputedStyle) { + whitespace = document.defaultView.getComputedStyle(node, null) + .getPropertyValue('white-space'); + } + // If it's preformatted, then we need to split lines on line breaks + // in addition to
s. + var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3); + + var li = document.createElement('LI'); while (node.firstChild) { li.appendChild(node.firstChild); } // An array of lines. We split below, so this is initialized to one // un-split line. var listItems = [li]; - + function walk(node) { switch (node.nodeType) { case 1: // Element if (nocode.test(node.className)) { break; } - if ('br' === node.nodeName) { + if ('BR' === node.nodeName) { breakAfter(node); // Discard the
since it is now flush against a . if (node.parentNode) { @@ -1022,7 +974,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ break; } } - + // Split a line after the given node. function breakAfter(lineEndNode) { // If there's nothing to the right, then we can skip ending the line @@ -1032,7 +984,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ lineEndNode = lineEndNode.parentNode; if (!lineEndNode) { return; } } - + function breakLeftOf(limit, copy) { // Clone shallowly if this node needs to be on both sides of the break. var rightSide = copy ? limit.cloneNode(false) : limit; @@ -1054,9 +1006,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } return rightSide; } - + var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0); - + // Walk the parent chain until we reach an unattached LI. for (var parent; // Check nodeType since IE invents document fragments. @@ -1066,20 +1018,20 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ // Put it on the list of lines for later processing. listItems.push(copiedListItem); } - + // Split lines while there are lines left to split. for (var i = 0; // Number of lines that have been split so far. i < listItems.length; // length updated by breakAfter calls. ++i) { walk(listItems[i]); } - + // Make sure numeric indices show correctly. if (opt_startLineNum === (opt_startLineNum|0)) { listItems[0].setAttribute('value', opt_startLineNum); } - - var ol = document.createElement('ol'); + + var ol = document.createElement('OL'); ol.className = 'linenums'; var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0; for (var i = 0, n = listItems.length; i < n; ++i) { @@ -1093,7 +1045,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } ol.appendChild(li); } - + node.appendChild(ol); } @@ -1111,26 +1063,25 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ * @private */ function recombineTagsAndDecorations(job) { - var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent); - isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8; + var isIE = /\bMSIE\b/.test(navigator.userAgent); var newlineRe = /\n/g; - + var source = job.sourceCode; var sourceLength = source.length; // Index into source after the last code-unit recombined. var sourceIndex = 0; - + var spans = job.spans; var nSpans = spans.length; // Index into spans after the last span which ends at or before sourceIndex. var spanIndex = 0; - + var decorations = job.decorations; var nDecorations = decorations.length; // Index into decorations after the last decoration which ends at or before // sourceIndex. var decorationIndex = 0; - + // Remove all zero-length decorations. decorations[nDecorations] = sourceLength; var decPos, i; @@ -1143,7 +1094,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ } } nDecorations = decPos; - + // Simplify decorations. for (i = decPos = 0; i < nDecorations;) { var startPos = decorations[i]; @@ -1157,65 +1108,52 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ decorations[decPos++] = startDec; i = end; } - + nDecorations = decorations.length = decPos; - - var sourceNode = job.sourceNode; - var oldDisplay; - if (sourceNode) { - oldDisplay = sourceNode.style.display; - sourceNode.style.display = 'none'; - } - try { - var decoration = null; - while (spanIndex < nSpans) { - var spanStart = spans[spanIndex]; - var spanEnd = spans[spanIndex + 2] || sourceLength; - - var decEnd = decorations[decorationIndex + 2] || sourceLength; - - var end = Math.min(spanEnd, decEnd); - - var textNode = spans[spanIndex + 1]; - var styledText; - if (textNode.nodeType !== 1 // Don't muck with
s or
  • s - // Don't introduce spans around empty text nodes. - && (styledText = source.substring(sourceIndex, end))) { - // This may seem bizarre, and it is. Emitting LF on IE causes the - // code to display with spaces instead of line breaks. - // Emitting Windows standard issue linebreaks (CRLF) causes a blank - // space to appear at the beginning of every line but the first. - // Emitting an old Mac OS 9 line separator makes everything spiffy. - if (isIE8OrEarlier) { - styledText = styledText.replace(newlineRe, '\r'); - } - textNode.nodeValue = styledText; - var document = textNode.ownerDocument; - var span = document.createElement('span'); - span.className = decorations[decorationIndex + 1]; - var parentNode = textNode.parentNode; - parentNode.replaceChild(span, textNode); - span.appendChild(textNode); - if (sourceIndex < spanEnd) { // Split off a text node. - spans[spanIndex + 1] = textNode - // TODO: Possibly optimize by using '' if there's no flicker. - = document.createTextNode(source.substring(end, spanEnd)); - parentNode.insertBefore(textNode, span.nextSibling); - } - } - - sourceIndex = end; - - if (sourceIndex >= spanEnd) { - spanIndex += 2; - } - if (sourceIndex >= decEnd) { - decorationIndex += 2; + + var decoration = null; + while (spanIndex < nSpans) { + var spanStart = spans[spanIndex]; + var spanEnd = spans[spanIndex + 2] || sourceLength; + + var decStart = decorations[decorationIndex]; + var decEnd = decorations[decorationIndex + 2] || sourceLength; + + var end = Math.min(spanEnd, decEnd); + + var textNode = spans[spanIndex + 1]; + var styledText; + if (textNode.nodeType !== 1 // Don't muck with
    s or
  • s + // Don't introduce spans around empty text nodes. + && (styledText = source.substring(sourceIndex, end))) { + // This may seem bizarre, and it is. Emitting LF on IE causes the + // code to display with spaces instead of line breaks. + // Emitting Windows standard issue linebreaks (CRLF) causes a blank + // space to appear at the beginning of every line but the first. + // Emitting an old Mac OS 9 line separator makes everything spiffy. + if (isIE) { styledText = styledText.replace(newlineRe, '\r'); } + textNode.nodeValue = styledText; + var document = textNode.ownerDocument; + var span = document.createElement('SPAN'); + span.className = decorations[decorationIndex + 1]; + var parentNode = textNode.parentNode; + parentNode.replaceChild(span, textNode); + span.appendChild(textNode); + if (sourceIndex < spanEnd) { // Split off a text node. + spans[spanIndex + 1] = textNode + // TODO: Possibly optimize by using '' if there's no flicker. + = document.createTextNode(source.substring(end, spanEnd)); + parentNode.insertBefore(textNode, span.nextSibling); } } - } finally { - if (sourceNode) { - sourceNode.style.display = oldDisplay; + + sourceIndex = end; + + if (sourceIndex >= spanEnd) { + spanIndex += 2; + } + if (sourceIndex >= decEnd) { + decorationIndex += 2; } } } @@ -1244,7 +1182,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ var ext = fileExtensions[i]; if (!langHandlerRegistry.hasOwnProperty(ext)) { langHandlerRegistry[ext] = handler; - } else if (win['console']) { + } else if (window['console']) { console['warn']('cannot override language handler %s', ext); } } @@ -1356,15 +1294,14 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ 'tripleQuotedStrings': true, 'regexLiterals': true }), ['coffee']); - registerLangHandler( - createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']); + registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']); function applyDecorator(job) { var opt_langExtension = job.langExtension; try { // Extract tags, and convert the source code to plain text. - var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre); + var sourceAndSpans = extractSourceSpans(job.sourceNode); /** Plain text. @type {string} */ var source = sourceAndSpans.sourceCode; job.sourceCode = source; @@ -1378,7 +1315,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ // modifying the sourceNode in place. recombineTagsAndDecorations(job); } catch (e) { - if (win['console']) { + if ('console' in window) { console['log'](e && e['stack'] ? e['stack'] : e); } } @@ -1392,20 +1329,19 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ * or the 1-indexed number of the first line in sourceCodeHtml. */ function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) { - var container = document.createElement('pre'); + var container = document.createElement('PRE'); // This could cause images to load and onload listeners to fire. // E.g. . // We assume that the inner HTML is from a trusted source. container.innerHTML = sourceCodeHtml; if (opt_numberLines) { - numberLines(container, opt_numberLines, true); + numberLines(container, opt_numberLines); } var job = { langExtension: opt_langExtension, numberLines: opt_numberLines, - sourceNode: container, - pre: 1 + sourceNode: container }; applyDecorator(job); return container.innerHTML; @@ -1435,88 +1371,59 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/; var prettyPrintRe = /\bprettyprint\b/; - var prettyPrintedRe = /\bprettyprinted\b/; - var preformattedTagNameRe = /pre|xmp/i; - var codeRe = /^code$/i; - var preCodeXmpRe = /^(?:pre|code|xmp)$/i; function doWork() { - var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ? + var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ? clock['now']() + 250 /* ms */ : Infinity); for (; k < elements.length && clock['now']() < endTime; k++) { var cs = elements[k]; var className = cs.className; - if (prettyPrintRe.test(className) - // Don't redo this if we've already done it. - // This allows recalling pretty print to just prettyprint elements - // that have been added to the page since last call. - && !prettyPrintedRe.test(className)) { + if (className.indexOf('prettyprint') >= 0) { + // If the classes includes a language extensions, use it. + // Language extensions can be specified like + //
    +          // the language extension "cpp" is used to find a language handler as
    +          // passed to PR.registerLangHandler.
    +          // HTML5 recommends that a language be specified using "language-"
    +          // as the prefix instead.  Google Code Prettify supports both.
    +          // http://dev.w3.org/html5/spec-author-view/the-code-element.html
    +          var langExtension = className.match(langExtensionRe);
    +          // Support 
    
    +          var wrapper;
    +          if (!langExtension && (wrapper = childContentWrapper(cs))
    +              && "CODE" === wrapper.tagName) {
    +            langExtension = wrapper.className.match(langExtensionRe);
    +          }
    +
    +          if (langExtension) {
    +            langExtension = langExtension[1];
    +          }
     
               // make sure this is not nested in an already prettified element
               var nested = false;
               for (var p = cs.parentNode; p; p = p.parentNode) {
    -            var tn = p.tagName;
    -            if (preCodeXmpRe.test(tn)
    -                && p.className && prettyPrintRe.test(p.className)) {
    +            if ((p.tagName === 'pre' || p.tagName === 'code' ||
    +                 p.tagName === 'xmp') &&
    +                p.className && p.className.indexOf('prettyprint') >= 0) {
                   nested = true;
                   break;
                 }
               }
               if (!nested) {
    -            // Mark done.  If we fail to prettyprint for whatever reason,
    -            // we shouldn't try again.
    -            cs.className += ' prettyprinted';
    -
    -            // If the classes includes a language extensions, use it.
    -            // Language extensions can be specified like
    -            //     
    -            // the language extension "cpp" is used to find a language handler
    -            // as passed to PR.registerLangHandler.
    -            // HTML5 recommends that a language be specified using "language-"
    -            // as the prefix instead.  Google Code Prettify supports both.
    -            // http://dev.w3.org/html5/spec-author-view/the-code-element.html
    -            var langExtension = className.match(langExtensionRe);
    -            // Support 
    
    -            var wrapper;
    -            if (!langExtension && (wrapper = childContentWrapper(cs))
    -                && codeRe.test(wrapper.tagName)) {
    -              langExtension = wrapper.className.match(langExtensionRe);
    -            }
    -
    -            if (langExtension) { langExtension = langExtension[1]; }
    -
    -            var preformatted;
    -            if (preformattedTagNameRe.test(cs.tagName)) {
    -              preformatted = 1;
    -            } else {
    -              var currentStyle = cs['currentStyle'];
    -              var whitespace = (
    -                  currentStyle
    -                  ? currentStyle['whiteSpace']
    -                  : (document.defaultView
    -                     && document.defaultView.getComputedStyle)
    -                  ? document.defaultView.getComputedStyle(cs, null)
    -                  .getPropertyValue('white-space')
    -                  : 0);
    -              preformatted = whitespace
    -                  && 'pre' === whitespace.substring(0, 3);
    -            }
    -
                 // Look for a class like linenums or linenums: where  is the
                 // 1-indexed number of the first line.
                 var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
                 lineNums = lineNums
    -                ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
    -                : false;
    -            if (lineNums) { numberLines(cs, lineNums, preformatted); }
    +                  ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
    +                  : false;
    +            if (lineNums) { numberLines(cs, lineNums); }
     
                 // do the pretty printing
                 prettyPrintingJob = {
                   langExtension: langExtension,
                   sourceNode: cs,
    -              numberLines: lineNums,
    -              pre: preformatted
    +              numberLines: lineNums
                 };
                 applyDecorator(prettyPrintingJob);
               }
    @@ -1533,11 +1440,26 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
         doWork();
       }
     
    -  /**
    -   * Contains functions for creating and registering new language handlers.
    -   * @type {Object}
    -   */
    -  var PR = win['PR'] = {
    +   /**
    +    * Find all the {@code 
    } and {@code } tags in the DOM with
    +    * {@code class=prettyprint} and prettify them.
    +    *
    +    * @param {Function?} opt_whenDone if specified, called when the last entry
    +    *     has been finished.
    +    */
    +  window['prettyPrintOne'] = prettyPrintOne;
    +   /**
    +    * Pretty print a chunk of code.
    +    *
    +    * @param {string} sourceCodeHtml code as html
    +    * @return {string} code as html, but prettier
    +    */
    +  window['prettyPrint'] = prettyPrint;
    +   /**
    +    * Contains functions for creating and registering new language handlers.
    +    * @type {Object}
    +    */
    +  window['PR'] = {
             'createSimpleLexer': createSimpleLexer,
             'registerLangHandler': registerLangHandler,
             'sourceDecorator': sourceDecorator,
    @@ -1553,34 +1475,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
             'PR_SOURCE': PR_SOURCE,
             'PR_STRING': PR_STRING,
             'PR_TAG': PR_TAG,
    -        'PR_TYPE': PR_TYPE,
    -        'prettyPrintOne': win['prettyPrintOne'] = prettyPrintOne,
    -        'prettyPrint': win['prettyPrint'] = prettyPrint
    +        'PR_TYPE': PR_TYPE
           };
    -
    -  // Make PR available via the Asynchronous Module Definition (AMD) API.
    -  // Per https://github.com/amdjs/amdjs-api/wiki/AMD:
    -  // The Asynchronous Module Definition (AMD) API specifies a
    -  // mechanism for defining modules such that the module and its
    -  // dependencies can be asynchronously loaded.
    -  // ...
    -  // To allow a clear indicator that a global define function (as
    -  // needed for script src browser loading) conforms to the AMD API,
    -  // any global define function SHOULD have a property called "amd"
    -  // whose value is an object. This helps avoid conflict with any
    -  // other existing JavaScript code that could have defined a define()
    -  // function that does not conform to the AMD API.
    -  if (typeof define === "function" && define['amd']) {
    -    define("google-code-prettify", [], function () {
    -      return PR; 
    -    });
    -  }
     })();
     
    -
    -// ***** Customization begin
    -
     // Contributed by Ryan Grove 
    +
     /**
      * @fileoverview
      * Registers a language handler for Handlebars.
    @@ -1629,6 +1529,113 @@ PR['registerLangHandler'](
     
     
     
    +// Copyright (C) 2009 Google Inc.
    +//
    +// Licensed under the Apache License, Version 2.0 (the "License");
    +// you may not use this file except in compliance with the License.
    +// You may obtain a copy of the License at
    +//
    +//      http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS,
    +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +// See the License for the specific language governing permissions and
    +// limitations under the License.
    +
    +/**
    + * @fileoverview
    + * Registers a language handler for CSS.
    + *
    + *
    + * To use, include prettify.js and this file in your HTML page.
    + * Then put your code in an HTML tag like
    + *      
    
    + *
    + *
    + * http://www.w3.org/TR/CSS21/grammar.html Section G2 defines the lexical
    + * grammar.  This scheme does not recognize keywords containing escapes.
    + *
    + * @author mikesamuel@gmail.com
    + */
    +
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer'](
    +        [
    +         // The space production 
    +         [PR['PR_PLAIN'],       /^[ \t\r\n\f]+/, null, ' \t\r\n\f']
    +        ],
    +        [
    +         // Quoted strings.   and 
    +         [PR['PR_STRING'],
    +          /^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null],
    +         [PR['PR_STRING'],
    +          /^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null],
    +         ['lang-css-str', /^url\(([^\)\"\']*)\)/i],
    +         [PR['PR_KEYWORD'],
    +          /^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,
    +          null],
    +         // A property name -- an identifier followed by a colon.
    +         ['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],
    +         // A C style block comment.  The  production.
    +         [PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
    +         // Escaping text spans
    +         [PR['PR_COMMENT'], /^(?:)/],
    +         // A number possibly containing a suffix.
    +         [PR['PR_LITERAL'], /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
    +         // A hex color
    +         [PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}/i],
    +         // An identifier
    +         [PR['PR_PLAIN'],
    +          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],
    +         // A run of punctuation
    +         [PR['PR_PUNCTUATION'], /^[^\s\w\'\"]+/]
    +        ]),
    +    ['css']);
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer']([],
    +        [
    +         [PR['PR_KEYWORD'],
    +          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]
    +        ]),
    +    ['css-kw']);
    +PR['registerLangHandler'](
    +    PR['createSimpleLexer']([],
    +        [
    +         [PR['PR_STRING'], /^[^\)\"\']+/]
    +        ]),
    +    ['css-str']);
    +?)(?:\?>|$)/],
    +      ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    +      ['lang-',        /^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    +
    +      // Unescaped Handlebars template in JavaScript.
    +      ['lang-handlebars', /^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    +
    +      // Unescaped content in javascript.  (Or possibly vbscript).
    +      ['lang-js',         /^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    +
    +      // Contains unescaped stylesheet content
    +      ['lang-css',        /^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    +      ['lang-in.tag',     /^(<\/?[a-z][^<>]*>)/i],
    +
    +      // -- Handlebars ---------------------------------------------------------
    +      // Tag (escaped).
    +      [PR['PR_DECLARATION'], /^{{[#^>/]?\s*[\w.][^}]*}}/],
    +
    +      // Tag (unescaped).
    +      [PR['PR_DECLARATION'], /^{{&?\s*[\w.][^}]*}}/],
    +
    +      // Tag (unescaped).
    +      [PR['PR_DECLARATION'], /^{{{>?\s*[\w.][^}]*}}}/],
    +
    +      // Comment.
    +      [PR['PR_COMMENT'], /^{{![^}]*}}/]
    +    ]),
    +['handlebars', 'hbs']);
    +
    +
    +
     // Copyright (C) 2009 Google Inc.
     //
     // Licensed under the Apache License, Version 2.0 (the "License");
    diff --git a/index.html b/index.html
    index f4b80e09..00864630 100644
    --- a/index.html
    +++ b/index.html
    @@ -24,7 +24,7 @@ 

    YUIDoc - Javascript Docume
    -

    Welcome to YUIDoc 0.3.29!

    +

    Welcome to YUIDoc 0.3.30!

    YUIDoc is a Node.js application that @@ -146,7 +146,7 @@

    Table of Contents