diff --git a/README.md b/README.md index 6afe7eced0..08a80871a5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # [Prism](http://prismjs.com/) [![Build Status](https://travis-ci.org/PrismJS/prism.svg?branch=master)](https://travis-ci.org/PrismJS/prism) +[![npm](https://img.shields.io/npm/dw/prismjs.svg)](https://www.npmjs.com/package/prismjs) Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](http://dabblet.com/). diff --git a/components.js b/components.js index 8b240aa880..53f3dee378 100644 --- a/components.js +++ b/components.js @@ -1,2 +1,2 @@ -var components = {"core":{"meta":{"path":"components/prism-core.js","option":"mandatory"},"core":"Core"},"themes":{"meta":{"path":"themes/{id}.css","link":"index.html?theme={id}","exclusive":true},"prism":{"title":"Default","option":"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{"title":"Okaidia","owner":"ocodia"},"prism-twilight":{"title":"Twilight","owner":"remybach"},"prism-coy":{"title":"Coy","owner":"tshedor"},"prism-solarizedlight":{"title":"Solarized Light","owner":"hectormatos2011 "},"prism-tomorrow":{"title":"Tomorrow Night","owner":"Rosey"}},"languages":{"meta":{"path":"components/prism-{id}","noCSS":true,"examplesPath":"examples/prism-{id}","addCheckAll":true},"markup":{"title":"Markup","alias":["html","xml","svg","mathml"],"aliasTitles":{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML"},"option":"default"},"css":{"title":"CSS","option":"default","peerDependencies":"markup"},"clike":{"title":"C-like","option":"default","overrideExampleHeader":true},"javascript":{"title":"JavaScript","require":"clike","peerDependencies":"markup","alias":"js","option":"default"},"abap":{"title":"ABAP","owner":"dellagustin"},"abnf":{"title":"Augmented Backus–Naur form","owner":"RunDevelopment"},"actionscript":{"title":"ActionScript","require":"javascript","peerDependencies":"markup","owner":"Golmote"},"ada":{"title":"Ada","owner":"Lucretia"},"apacheconf":{"title":"Apache Configuration","owner":"GuiTeK"},"apl":{"title":"APL","owner":"ngn"},"applescript":{"title":"AppleScript","owner":"Golmote"},"arduino":{"title":"Arduino","require":"cpp","owner":"eisbehr-"},"arff":{"title":"ARFF","owner":"Golmote"},"asciidoc":{"alias":"adoc","title":"AsciiDoc","owner":"Golmote"},"asm6502":{"title":"6502 Assembly","owner":"kzurawel"},"aspnet":{"title":"ASP.NET (C#)","require":["markup","csharp"],"owner":"nauzilus"},"autohotkey":{"title":"AutoHotkey","owner":"aviaryan"},"autoit":{"title":"AutoIt","owner":"Golmote"},"bash":{"title":"Bash","alias":"shell","aliasTitles":{"shell":"Shell"},"owner":"zeitgeist87"},"basic":{"title":"BASIC","owner":"Golmote"},"batch":{"title":"Batch","owner":"Golmote"},"bison":{"title":"Bison","require":"c","owner":"Golmote"},"bnf":{"title":"Backus–Naur form","alias":"rbnf","aliasTitles":{"rbnf":"Routing Backus–Naur form"},"owner":"RunDevelopment"},"brainfuck":{"title":"Brainfuck","owner":"Golmote"},"bro":{"title":"Bro","owner":"wayward710"},"c":{"title":"C","require":"clike","owner":"zeitgeist87"},"csharp":{"title":"C#","require":"clike","alias":["cs","dotnet"],"owner":"mvalipour"},"cpp":{"title":"C++","require":"c","owner":"zeitgeist87"},"cil":{"title":"CIL","owner":"sbrl"},"coffeescript":{"title":"CoffeeScript","require":"javascript","alias":"coffee","owner":"R-osey"},"cmake":{"title":"CMake","owner":"mjrogozinski"},"clojure":{"title":"Clojure","owner":"troglotit"},"crystal":{"title":"Crystal","require":"ruby","owner":"MakeNowJust"},"csp":{"title":"Content-Security-Policy","owner":"ScottHelme"},"css-extras":{"title":"CSS Extras","require":"css","owner":"milesj"},"d":{"title":"D","require":"clike","owner":"Golmote"},"dart":{"title":"Dart","require":"clike","owner":"Golmote"},"diff":{"title":"Diff","owner":"uranusjr"},"django":{"title":"Django/Jinja2","require":"markup-templating","alias":"jinja2","owner":"romanvm"},"docker":{"title":"Docker","alias":"dockerfile","owner":"JustinBeckwith"},"ebnf":{"title":"Extended Backus–Naur form","owner":"RunDevelopment"},"eiffel":{"title":"Eiffel","owner":"Conaclos"},"ejs":{"title":"EJS","require":["javascript","markup-templating"],"owner":"RunDevelopment"},"elixir":{"title":"Elixir","owner":"Golmote"},"elm":{"title":"Elm","owner":"zwilias"},"erb":{"title":"ERB","require":["ruby","markup-templating"],"owner":"Golmote"},"erlang":{"title":"Erlang","owner":"Golmote"},"fsharp":{"title":"F#","require":"clike","owner":"simonreynolds7"},"flow":{"title":"Flow","require":"javascript","owner":"Golmote"},"fortran":{"title":"Fortran","owner":"Golmote"},"gcode":{"title":"G-code","owner":"RunDevelopment"},"gedcom":{"title":"GEDCOM","owner":"Golmote"},"gherkin":{"title":"Gherkin","owner":"hason"},"git":{"title":"Git","owner":"lgiraudel"},"glsl":{"title":"GLSL","require":"clike","owner":"Golmote"},"gml":{"title":"GameMaker Language","alias":"gamemakerlanguage","require":"clike","owner":"LiarOnce"},"go":{"title":"Go","require":"clike","owner":"arnehormann"},"graphql":{"title":"GraphQL","owner":"Golmote"},"groovy":{"title":"Groovy","require":"clike","owner":"robfletcher"},"haml":{"title":"Haml","require":"ruby","peerDependencies":["css","coffeescript","erb","javascript","less","markdown","ruby","scss","textile"],"owner":"Golmote"},"handlebars":{"title":"Handlebars","require":"markup-templating","owner":"Golmote"},"haskell":{"title":"Haskell","alias":"hs","owner":"bholst"},"haxe":{"title":"Haxe","require":"clike","owner":"Golmote"},"hcl":{"title":"HCL","owner":"outsideris"},"http":{"title":"HTTP","peerDependencies":["javascript","markup"],"owner":"danielgtaylor"},"hpkp":{"title":"HTTP Public-Key-Pins","owner":"ScottHelme"},"hsts":{"title":"HTTP Strict-Transport-Security","owner":"ScottHelme"},"ichigojam":{"title":"IchigoJam","owner":"BlueCocoa"},"icon":{"title":"Icon","owner":"Golmote"},"inform7":{"title":"Inform 7","owner":"Golmote"},"ini":{"title":"Ini","owner":"aviaryan"},"io":{"title":"Io","owner":"AlesTsurko"},"j":{"title":"J","owner":"Golmote"},"java":{"title":"Java","require":"clike","owner":"sherblot"},"javadoc":{"title":"JavaDoc","require":["markup","java","javadoclike"],"peerDependencies":["scala"],"owner":"RunDevelopment"},"javadoclike":{"title":"JavaDoc-like","peerDependencies":["java","javascript","php"],"owner":"RunDevelopment"},"javastacktrace":{"title":"Java stack trace","owner":"RunDevelopment"},"jolie":{"title":"Jolie","require":"clike","owner":"thesave"},"jq":{"title":"JQ","owner":"RunDevelopment"},"jsdoc":{"title":"JSDoc","require":["javascript","javadoclike"],"peerDependencies":["actionscript","coffeescript"],"owner":"RunDevelopment"},"js-extras":{"title":"JS Extras","require":"javascript","peerDependencies":["actionscript","coffeescript","flow","n4js","typescript"],"owner":"RunDevelopment"},"json":{"title":"JSON","owner":"CupOfTea696"},"jsonp":{"title":"JSONP","require":"json","owner":"RunDevelopment"},"json5":{"title":"JSON5","require":"json","owner":"RunDevelopment"},"julia":{"title":"Julia","owner":"cdagnino"},"keyman":{"title":"Keyman","owner":"mcdurdin"},"kotlin":{"title":"Kotlin","require":"clike","owner":"Golmote"},"latex":{"title":"LaTeX","alias":["tex","context"],"aliasTitles":{"tex":"TeX","context":"ConTeXt"},"owner":"japborst"},"less":{"title":"Less","require":"css","owner":"Golmote"},"liquid":{"title":"Liquid","owner":"cinhtau"},"lisp":{"title":"Lisp","alias":["emacs","elisp","emacs-lisp"],"owner":"JuanCaicedo"},"livescript":{"title":"LiveScript","owner":"Golmote"},"lolcode":{"title":"LOLCODE","owner":"Golmote"},"lua":{"title":"Lua","owner":"Golmote"},"makefile":{"title":"Makefile","owner":"Golmote"},"markdown":{"title":"Markdown","require":"markup","alias":"md","owner":"Golmote"},"markup-templating":{"title":"Markup templating","require":"markup","owner":"Golmote"},"matlab":{"title":"MATLAB","owner":"Golmote"},"mel":{"title":"MEL","owner":"Golmote"},"mizar":{"title":"Mizar","owner":"Golmote"},"monkey":{"title":"Monkey","owner":"Golmote"},"n1ql":{"title":"N1QL","owner":"TMWilds"},"n4js":{"title":"N4JS","require":"javascript","peerDependencies":["jsdoc"],"alias":"n4jsd","owner":"bsmith-n4"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","owner":"stephanmax"},"nasm":{"title":"NASM","owner":"rbmj"},"nginx":{"title":"nginx","owner":"westonganger","require":"clike"},"nim":{"title":"Nim","owner":"Golmote"},"nix":{"title":"Nix","owner":"Golmote"},"nsis":{"title":"NSIS","owner":"idleberg"},"objectivec":{"title":"Objective-C","require":"c","owner":"uranusjr"},"ocaml":{"title":"OCaml","owner":"Golmote"},"opencl":{"title":"OpenCL","require":"cpp","peerDependencies":["c","cpp"],"overrideExampleHeader":true,"owner":"Milania1"},"oz":{"title":"Oz","owner":"Golmote"},"parigp":{"title":"PARI/GP","owner":"Golmote"},"parser":{"title":"Parser","require":"markup","owner":"Golmote"},"pascal":{"title":"Pascal","alias":"objectpascal","aliasTitles":{"objectpascal":"Object Pascal"},"owner":"Golmote"},"pascaligo":{"title":"Pascaligo","owner":"DefinitelyNotAGoat"},"perl":{"title":"Perl","owner":"Golmote"},"php":{"title":"PHP","require":["clike","markup-templating"],"owner":"milesj"},"phpdoc":{"title":"PHPDoc","require":["php","javadoclike"],"owner":"RunDevelopment"},"php-extras":{"title":"PHP Extras","require":"php","owner":"milesj"},"plsql":{"title":"PL/SQL","require":"sql","owner":"Golmote"},"powershell":{"title":"PowerShell","owner":"nauzilus"},"processing":{"title":"Processing","require":"clike","owner":"Golmote"},"prolog":{"title":"Prolog","owner":"Golmote"},"properties":{"title":".properties","owner":"Golmote"},"protobuf":{"title":"Protocol Buffers","require":"clike","owner":"just-boris"},"pug":{"title":"Pug","require":["markup","javascript"],"peerDependencies":["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],"owner":"Golmote"},"puppet":{"title":"Puppet","owner":"Golmote"},"pure":{"title":"Pure","peerDependencies":["c","cpp","fortran"],"owner":"Golmote"},"python":{"title":"Python","alias":"py","owner":"multipetros"},"q":{"title":"Q (kdb+ database)","owner":"Golmote"},"qore":{"title":"Qore","require":"clike","owner":"temnroegg"},"r":{"title":"R","owner":"Golmote"},"jsx":{"title":"React JSX","require":["markup","javascript"],"peerDependencies":["jsdoc","js-extras"],"owner":"vkbansal"},"tsx":{"title":"React TSX","require":["jsx","typescript"]},"renpy":{"title":"Ren'py","owner":"HyuchiaDiego"},"reason":{"title":"Reason","require":"clike","owner":"Golmote"},"regex":{"title":"Regex","peerDependencies":["actionscript","coffeescript","flow","javascript","typescript","vala"],"owner":"RunDevelopment"},"rest":{"title":"reST (reStructuredText)","owner":"Golmote"},"rip":{"title":"Rip","owner":"ravinggenius"},"roboconf":{"title":"Roboconf","owner":"Golmote"},"ruby":{"title":"Ruby","require":"clike","alias":"rb","owner":"samflores"},"rust":{"title":"Rust","owner":"Golmote"},"sas":{"title":"SAS","owner":"Golmote"},"sass":{"title":"Sass (Sass)","require":"css","owner":"Golmote"},"scss":{"title":"Sass (Scss)","require":"css","owner":"MoOx"},"scala":{"title":"Scala","require":"java","owner":"jozic"},"scheme":{"title":"Scheme","owner":"bacchus123"},"shell-session":{"title":"Shell session","require":"bash","owner":"RunDevelopment"},"smalltalk":{"title":"Smalltalk","owner":"Golmote"},"smarty":{"title":"Smarty","require":"markup-templating","owner":"Golmote"},"sql":{"title":"SQL","owner":"multipetros"},"soy":{"title":"Soy (Closure Template)","require":"markup-templating","owner":"Golmote"},"stylus":{"title":"Stylus","owner":"vkbansal"},"swift":{"title":"Swift","require":"clike","owner":"chrischares"},"tap":{"title":"TAP","owner":"isaacs","require":"yaml"},"tcl":{"title":"Tcl","owner":"PeterChaplin"},"textile":{"title":"Textile","require":"markup","peerDependencies":"css","owner":"Golmote"},"toml":{"title":"TOML","owner":"RunDevelopment"},"tt2":{"title":"Template Toolkit 2","require":["clike","markup-templating"],"owner":"gflohr"},"twig":{"title":"Twig","require":"markup","owner":"brandonkelly"},"typescript":{"title":"TypeScript","require":"javascript","alias":"ts","owner":"vkbansal"},"t4-cs":{"title":"T4 Text Templates (C#)","require":["t4-templating","csharp"],"alias":"t4","owner":"RunDevelopment"},"t4-vb":{"title":"T4 Text Templates (VB)","require":["t4-templating","visual-basic"],"owner":"RunDevelopment"},"t4-templating":{"title":"T4 templating","owner":"RunDevelopment"},"vala":{"title":"Vala","require":"clike","owner":"TemplarVolk"},"vbnet":{"title":"VB.Net","require":"basic","owner":"Bigsby"},"velocity":{"title":"Velocity","require":"markup","owner":"Golmote"},"verilog":{"title":"Verilog","owner":"a-rey"},"vhdl":{"title":"VHDL","owner":"a-rey"},"vim":{"title":"vim","owner":"westonganger"},"visual-basic":{"title":"Visual Basic","alias":"vb","owner":"Golmote"},"wasm":{"title":"WebAssembly","owner":"Golmote"},"wiki":{"title":"Wiki markup","require":"markup","owner":"Golmote"},"xeora":{"title":"Xeora","require":"markup","alias":"xeoracube","aliasTitles":{"xeoracube":"XeoraCube"},"owner":"freakmaxi"},"xojo":{"title":"Xojo (REALbasic)","owner":"Golmote"},"xquery":{"title":"XQuery","require":"markup","owner":"Golmote"},"yaml":{"title":"YAML","alias":"yml","owner":"hason"}},"plugins":{"meta":{"path":"plugins/{id}/prism-{id}","link":"plugins/{id}/"},"line-highlight":"Line Highlight","line-numbers":{"title":"Line Numbers","owner":"kuba-kubula"},"show-invisibles":{"title":"Show Invisibles","after":["autolinker","data-uri-highlight"]},"autolinker":"Autolinker","wpd":"WebPlatform Docs","custom-class":{"title":"Custom Class","owner":"dvkndn","noCSS":true},"file-highlight":{"title":"File Highlight","noCSS":true},"show-language":{"title":"Show Language","owner":"nauzilus","noCSS":true,"require":"toolbar"},"jsonp-highlight":{"title":"JSONP Highlight","noCSS":true,"owner":"nauzilus"},"highlight-keywords":{"title":"Highlight Keywords","owner":"vkbansal","noCSS":true},"remove-initial-line-feed":{"title":"Remove initial line feed","owner":"Golmote","noCSS":true},"previewers":{"title":"Previewers","owner":"Golmote"},"autoloader":{"title":"Autoloader","owner":"Golmote","noCSS":true},"keep-markup":{"title":"Keep Markup","owner":"Golmote","after":"normalize-whitespace","noCSS":true},"command-line":{"title":"Command Line","owner":"chriswells0"},"unescaped-markup":"Unescaped Markup","normalize-whitespace":{"title":"Normalize Whitespace","owner":"zeitgeist87","after":"unescaped-markup","noCSS":true},"data-uri-highlight":{"title":"Data-URI Highlight","owner":"Golmote","noCSS":true},"toolbar":{"title":"Toolbar","owner":"mAAdhaTTah"},"copy-to-clipboard":{"title":"Copy to Clipboard Button","owner":"mAAdhaTTah","require":"toolbar","noCSS":true}}}; +var components = {"core":{"meta":{"path":"components/prism-core.js","option":"mandatory"},"core":"Core"},"themes":{"meta":{"path":"themes/{id}.css","link":"index.html?theme={id}","exclusive":true},"prism":{"title":"Default","option":"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{"title":"Okaidia","owner":"ocodia"},"prism-twilight":{"title":"Twilight","owner":"remybach"},"prism-coy":{"title":"Coy","owner":"tshedor"},"prism-solarizedlight":{"title":"Solarized Light","owner":"hectormatos2011 "},"prism-tomorrow":{"title":"Tomorrow Night","owner":"Rosey"}},"languages":{"meta":{"path":"components/prism-{id}","noCSS":true,"examplesPath":"examples/prism-{id}","addCheckAll":true},"markup":{"title":"Markup","alias":["html","xml","svg","mathml"],"aliasTitles":{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML"},"option":"default"},"css":{"title":"CSS","option":"default","peerDependencies":"markup"},"clike":{"title":"C-like","option":"default","overrideExampleHeader":true},"javascript":{"title":"JavaScript","require":"clike","peerDependencies":"markup","alias":"js","option":"default"},"abap":{"title":"ABAP","owner":"dellagustin"},"abnf":{"title":"Augmented Backus–Naur form","owner":"RunDevelopment"},"actionscript":{"title":"ActionScript","require":"javascript","peerDependencies":"markup","owner":"Golmote"},"ada":{"title":"Ada","owner":"Lucretia"},"apacheconf":{"title":"Apache Configuration","owner":"GuiTeK"},"apl":{"title":"APL","owner":"ngn"},"applescript":{"title":"AppleScript","owner":"Golmote"},"arduino":{"title":"Arduino","require":"cpp","owner":"eisbehr-"},"arff":{"title":"ARFF","owner":"Golmote"},"asciidoc":{"alias":"adoc","title":"AsciiDoc","owner":"Golmote"},"asm6502":{"title":"6502 Assembly","owner":"kzurawel"},"aspnet":{"title":"ASP.NET (C#)","require":["markup","csharp"],"owner":"nauzilus"},"autohotkey":{"title":"AutoHotkey","owner":"aviaryan"},"autoit":{"title":"AutoIt","owner":"Golmote"},"bash":{"title":"Bash","alias":"shell","aliasTitles":{"shell":"Shell"},"owner":"zeitgeist87"},"basic":{"title":"BASIC","owner":"Golmote"},"batch":{"title":"Batch","owner":"Golmote"},"bison":{"title":"Bison","require":"c","owner":"Golmote"},"bnf":{"title":"Backus–Naur form","alias":"rbnf","aliasTitles":{"rbnf":"Routing Backus–Naur form"},"owner":"RunDevelopment"},"brainfuck":{"title":"Brainfuck","owner":"Golmote"},"bro":{"title":"Bro","owner":"wayward710"},"c":{"title":"C","require":"clike","owner":"zeitgeist87"},"csharp":{"title":"C#","require":"clike","alias":["cs","dotnet"],"owner":"mvalipour"},"cpp":{"title":"C++","require":"c","owner":"zeitgeist87"},"cil":{"title":"CIL","owner":"sbrl"},"coffeescript":{"title":"CoffeeScript","require":"javascript","alias":"coffee","owner":"R-osey"},"cmake":{"title":"CMake","owner":"mjrogozinski"},"clojure":{"title":"Clojure","owner":"troglotit"},"crystal":{"title":"Crystal","require":"ruby","owner":"MakeNowJust"},"csp":{"title":"Content-Security-Policy","owner":"ScottHelme"},"css-extras":{"title":"CSS Extras","require":"css","owner":"milesj"},"d":{"title":"D","require":"clike","owner":"Golmote"},"dart":{"title":"Dart","require":"clike","owner":"Golmote"},"diff":{"title":"Diff","owner":"uranusjr"},"django":{"title":"Django/Jinja2","require":"markup-templating","alias":"jinja2","owner":"romanvm"},"docker":{"title":"Docker","alias":"dockerfile","owner":"JustinBeckwith"},"ebnf":{"title":"Extended Backus–Naur form","owner":"RunDevelopment"},"eiffel":{"title":"Eiffel","owner":"Conaclos"},"ejs":{"title":"EJS","require":["javascript","markup-templating"],"owner":"RunDevelopment"},"elixir":{"title":"Elixir","owner":"Golmote"},"elm":{"title":"Elm","owner":"zwilias"},"erb":{"title":"ERB","require":["ruby","markup-templating"],"owner":"Golmote"},"erlang":{"title":"Erlang","owner":"Golmote"},"fsharp":{"title":"F#","require":"clike","owner":"simonreynolds7"},"flow":{"title":"Flow","require":"javascript","owner":"Golmote"},"fortran":{"title":"Fortran","owner":"Golmote"},"gcode":{"title":"G-code","owner":"RunDevelopment"},"gedcom":{"title":"GEDCOM","owner":"Golmote"},"gherkin":{"title":"Gherkin","owner":"hason"},"git":{"title":"Git","owner":"lgiraudel"},"glsl":{"title":"GLSL","require":"clike","owner":"Golmote"},"gml":{"title":"GameMaker Language","alias":"gamemakerlanguage","require":"clike","owner":"LiarOnce"},"go":{"title":"Go","require":"clike","owner":"arnehormann"},"graphql":{"title":"GraphQL","owner":"Golmote"},"groovy":{"title":"Groovy","require":"clike","owner":"robfletcher"},"haml":{"title":"Haml","require":"ruby","peerDependencies":["css","coffeescript","erb","javascript","less","markdown","ruby","scss","textile"],"owner":"Golmote"},"handlebars":{"title":"Handlebars","require":"markup-templating","owner":"Golmote"},"haskell":{"title":"Haskell","alias":"hs","owner":"bholst"},"haxe":{"title":"Haxe","require":"clike","owner":"Golmote"},"hcl":{"title":"HCL","owner":"outsideris"},"http":{"title":"HTTP","peerDependencies":["javascript","markup"],"owner":"danielgtaylor"},"hpkp":{"title":"HTTP Public-Key-Pins","owner":"ScottHelme"},"hsts":{"title":"HTTP Strict-Transport-Security","owner":"ScottHelme"},"ichigojam":{"title":"IchigoJam","owner":"BlueCocoa"},"icon":{"title":"Icon","owner":"Golmote"},"inform7":{"title":"Inform 7","owner":"Golmote"},"ini":{"title":"Ini","owner":"aviaryan"},"io":{"title":"Io","owner":"AlesTsurko"},"j":{"title":"J","owner":"Golmote"},"java":{"title":"Java","require":"clike","owner":"sherblot"},"javadoc":{"title":"JavaDoc","require":["markup","java","javadoclike"],"peerDependencies":["scala"],"owner":"RunDevelopment"},"javadoclike":{"title":"JavaDoc-like","peerDependencies":["java","javascript","php"],"owner":"RunDevelopment"},"javastacktrace":{"title":"Java stack trace","owner":"RunDevelopment"},"jolie":{"title":"Jolie","require":"clike","owner":"thesave"},"jq":{"title":"JQ","owner":"RunDevelopment"},"jsdoc":{"title":"JSDoc","require":["javascript","javadoclike"],"peerDependencies":["actionscript","coffeescript"],"owner":"RunDevelopment"},"js-extras":{"title":"JS Extras","require":"javascript","peerDependencies":["actionscript","coffeescript","flow","n4js","typescript"],"owner":"RunDevelopment"},"json":{"title":"JSON","owner":"CupOfTea696"},"jsonp":{"title":"JSONP","require":"json","owner":"RunDevelopment"},"json5":{"title":"JSON5","require":"json","owner":"RunDevelopment"},"julia":{"title":"Julia","owner":"cdagnino"},"keyman":{"title":"Keyman","owner":"mcdurdin"},"kotlin":{"title":"Kotlin","require":"clike","owner":"Golmote"},"latex":{"title":"LaTeX","alias":["tex","context"],"aliasTitles":{"tex":"TeX","context":"ConTeXt"},"owner":"japborst"},"less":{"title":"Less","require":"css","owner":"Golmote"},"liquid":{"title":"Liquid","owner":"cinhtau"},"lisp":{"title":"Lisp","alias":["emacs","elisp","emacs-lisp"],"owner":"JuanCaicedo"},"livescript":{"title":"LiveScript","owner":"Golmote"},"lolcode":{"title":"LOLCODE","owner":"Golmote"},"lua":{"title":"Lua","owner":"Golmote"},"makefile":{"title":"Makefile","owner":"Golmote"},"markdown":{"title":"Markdown","require":"markup","alias":"md","owner":"Golmote"},"markup-templating":{"title":"Markup templating","require":"markup","owner":"Golmote"},"matlab":{"title":"MATLAB","owner":"Golmote"},"mel":{"title":"MEL","owner":"Golmote"},"mizar":{"title":"Mizar","owner":"Golmote"},"monkey":{"title":"Monkey","owner":"Golmote"},"n1ql":{"title":"N1QL","owner":"TMWilds"},"n4js":{"title":"N4JS","require":"javascript","peerDependencies":["jsdoc"],"alias":"n4jsd","owner":"bsmith-n4"},"nand2tetris-hdl":{"title":"Nand To Tetris HDL","owner":"stephanmax"},"nasm":{"title":"NASM","owner":"rbmj"},"nginx":{"title":"nginx","owner":"westonganger","require":"clike"},"nim":{"title":"Nim","owner":"Golmote"},"nix":{"title":"Nix","owner":"Golmote"},"nsis":{"title":"NSIS","owner":"idleberg"},"objectivec":{"title":"Objective-C","require":"c","owner":"uranusjr"},"ocaml":{"title":"OCaml","owner":"Golmote"},"opencl":{"title":"OpenCL","require":"cpp","peerDependencies":["c","cpp"],"overrideExampleHeader":true,"owner":"Milania1"},"oz":{"title":"Oz","owner":"Golmote"},"parigp":{"title":"PARI/GP","owner":"Golmote"},"parser":{"title":"Parser","require":"markup","owner":"Golmote"},"pascal":{"title":"Pascal","alias":"objectpascal","aliasTitles":{"objectpascal":"Object Pascal"},"owner":"Golmote"},"pascaligo":{"title":"Pascaligo","owner":"DefinitelyNotAGoat"},"pcaxis":{"title":"PC-Axis","alias":"px","owner":"RunDevelopment"},"perl":{"title":"Perl","owner":"Golmote"},"php":{"title":"PHP","require":["clike","markup-templating"],"owner":"milesj"},"phpdoc":{"title":"PHPDoc","require":["php","javadoclike"],"owner":"RunDevelopment"},"php-extras":{"title":"PHP Extras","require":"php","owner":"milesj"},"plsql":{"title":"PL/SQL","require":"sql","owner":"Golmote"},"powershell":{"title":"PowerShell","owner":"nauzilus"},"processing":{"title":"Processing","require":"clike","owner":"Golmote"},"prolog":{"title":"Prolog","owner":"Golmote"},"properties":{"title":".properties","owner":"Golmote"},"protobuf":{"title":"Protocol Buffers","require":"clike","owner":"just-boris"},"pug":{"title":"Pug","require":["markup","javascript"],"peerDependencies":["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],"owner":"Golmote"},"puppet":{"title":"Puppet","owner":"Golmote"},"pure":{"title":"Pure","peerDependencies":["c","cpp","fortran"],"owner":"Golmote"},"python":{"title":"Python","alias":"py","owner":"multipetros"},"q":{"title":"Q (kdb+ database)","owner":"Golmote"},"qore":{"title":"Qore","require":"clike","owner":"temnroegg"},"r":{"title":"R","owner":"Golmote"},"jsx":{"title":"React JSX","require":["markup","javascript"],"peerDependencies":["jsdoc","js-extras"],"owner":"vkbansal"},"tsx":{"title":"React TSX","require":["jsx","typescript"]},"renpy":{"title":"Ren'py","owner":"HyuchiaDiego"},"reason":{"title":"Reason","require":"clike","owner":"Golmote"},"regex":{"title":"Regex","peerDependencies":["actionscript","coffeescript","flow","javascript","typescript","vala"],"owner":"RunDevelopment"},"rest":{"title":"reST (reStructuredText)","owner":"Golmote"},"rip":{"title":"Rip","owner":"ravinggenius"},"roboconf":{"title":"Roboconf","owner":"Golmote"},"ruby":{"title":"Ruby","require":"clike","alias":"rb","owner":"samflores"},"rust":{"title":"Rust","owner":"Golmote"},"sas":{"title":"SAS","owner":"Golmote"},"sass":{"title":"Sass (Sass)","require":"css","owner":"Golmote"},"scss":{"title":"Sass (Scss)","require":"css","owner":"MoOx"},"scala":{"title":"Scala","require":"java","owner":"jozic"},"scheme":{"title":"Scheme","owner":"bacchus123"},"shell-session":{"title":"Shell session","require":"bash","owner":"RunDevelopment"},"smalltalk":{"title":"Smalltalk","owner":"Golmote"},"smarty":{"title":"Smarty","require":"markup-templating","owner":"Golmote"},"sql":{"title":"SQL","owner":"multipetros"},"soy":{"title":"Soy (Closure Template)","require":"markup-templating","owner":"Golmote"},"stylus":{"title":"Stylus","owner":"vkbansal"},"swift":{"title":"Swift","require":"clike","owner":"chrischares"},"tap":{"title":"TAP","owner":"isaacs","require":"yaml"},"tcl":{"title":"Tcl","owner":"PeterChaplin"},"textile":{"title":"Textile","require":"markup","peerDependencies":"css","owner":"Golmote"},"toml":{"title":"TOML","owner":"RunDevelopment"},"tt2":{"title":"Template Toolkit 2","require":["clike","markup-templating"],"owner":"gflohr"},"twig":{"title":"Twig","require":"markup","owner":"brandonkelly"},"typescript":{"title":"TypeScript","require":"javascript","alias":"ts","owner":"vkbansal"},"t4-cs":{"title":"T4 Text Templates (C#)","require":["t4-templating","csharp"],"alias":"t4","owner":"RunDevelopment"},"t4-vb":{"title":"T4 Text Templates (VB)","require":["t4-templating","visual-basic"],"owner":"RunDevelopment"},"t4-templating":{"title":"T4 templating","owner":"RunDevelopment"},"vala":{"title":"Vala","require":"clike","owner":"TemplarVolk"},"vbnet":{"title":"VB.Net","require":"basic","owner":"Bigsby"},"velocity":{"title":"Velocity","require":"markup","owner":"Golmote"},"verilog":{"title":"Verilog","owner":"a-rey"},"vhdl":{"title":"VHDL","owner":"a-rey"},"vim":{"title":"vim","owner":"westonganger"},"visual-basic":{"title":"Visual Basic","alias":"vb","owner":"Golmote"},"wasm":{"title":"WebAssembly","owner":"Golmote"},"wiki":{"title":"Wiki markup","require":"markup","owner":"Golmote"},"xeora":{"title":"Xeora","require":"markup","alias":"xeoracube","aliasTitles":{"xeoracube":"XeoraCube"},"owner":"freakmaxi"},"xojo":{"title":"Xojo (REALbasic)","owner":"Golmote"},"xquery":{"title":"XQuery","require":"markup","owner":"Golmote"},"yaml":{"title":"YAML","alias":"yml","owner":"hason"}},"plugins":{"meta":{"path":"plugins/{id}/prism-{id}","link":"plugins/{id}/"},"line-highlight":"Line Highlight","line-numbers":{"title":"Line Numbers","owner":"kuba-kubula"},"show-invisibles":{"title":"Show Invisibles","after":["autolinker","data-uri-highlight"]},"autolinker":"Autolinker","wpd":"WebPlatform Docs","custom-class":{"title":"Custom Class","owner":"dvkndn","noCSS":true},"file-highlight":{"title":"File Highlight","noCSS":true},"show-language":{"title":"Show Language","owner":"nauzilus","noCSS":true,"require":"toolbar"},"jsonp-highlight":{"title":"JSONP Highlight","noCSS":true,"owner":"nauzilus"},"highlight-keywords":{"title":"Highlight Keywords","owner":"vkbansal","noCSS":true},"remove-initial-line-feed":{"title":"Remove initial line feed","owner":"Golmote","noCSS":true},"previewers":{"title":"Previewers","owner":"Golmote"},"autoloader":{"title":"Autoloader","owner":"Golmote","noCSS":true},"keep-markup":{"title":"Keep Markup","owner":"Golmote","after":"normalize-whitespace","noCSS":true},"command-line":{"title":"Command Line","owner":"chriswells0"},"unescaped-markup":"Unescaped Markup","normalize-whitespace":{"title":"Normalize Whitespace","owner":"zeitgeist87","after":"unescaped-markup","noCSS":true},"data-uri-highlight":{"title":"Data-URI Highlight","owner":"Golmote","noCSS":true},"toolbar":{"title":"Toolbar","owner":"mAAdhaTTah"},"copy-to-clipboard":{"title":"Copy to Clipboard Button","owner":"mAAdhaTTah","require":"toolbar","noCSS":true}}}; if (typeof module !== 'undefined' && module.exports) { module.exports = components; } \ No newline at end of file diff --git a/components.json b/components.json index 17533c5b53..22cfbc0df5 100644 --- a/components.json +++ b/components.json @@ -636,6 +636,11 @@ "title": "Pascaligo", "owner": "DefinitelyNotAGoat" }, + "pcaxis": { + "title": "PC-Axis", + "alias": "px", + "owner": "RunDevelopment" + }, "perl": { "title": "Perl", "owner": "Golmote" diff --git a/components/prism-markdown.js b/components/prism-markdown.js index 18a5154cb1..94adc834b1 100644 --- a/components/prism-markdown.js +++ b/components/prism-markdown.js @@ -1,227 +1,283 @@ -Prism.languages.markdown = Prism.languages.extend('markup', {}); -Prism.languages.insertBefore('markdown', 'prolog', { - 'blockquote': { - // > ... - pattern: /^>(?:[\t ]*>)*/m, - alias: 'punctuation' - }, - 'code': [ - { - // Prefixed by 4 spaces or 1 tab - pattern: /^(?: {4}|\t).+/m, - alias: 'keyword' +(function (Prism) { + + // Allow only one line break + var inner = /\\.|[^\\\n\r_]|(?:\r?\n|\r)(?!\r?\n|\r)/.source; + + /** + * This function is intended for the creation of the bold or italic pattern. + * + * This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped. + * + * _Note:_ Keep in mind that this adds a capturing group. + * + * @param {string} pattern + * @param {boolean} starAlternative Whether to also add an alternative where all `_`s are replaced with `*`s. + * @returns {RegExp} + */ + function createInline(pattern, starAlternative) { + pattern = pattern.replace(//g, inner); + if (starAlternative) { + pattern = pattern + '|' + pattern.replace(/_/g, '\\*'); + } + return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')'); + } + + + Prism.languages.markdown = Prism.languages.extend('markup', {}); + Prism.languages.insertBefore('markdown', 'prolog', { + 'blockquote': { + // > ... + pattern: /^>(?:[\t ]*>)*/m, + alias: 'punctuation' }, - { - // `code` - // ``code`` - pattern: /``.+?``|`[^`\n]+`/, - alias: 'keyword' + 'code': [ + { + // Prefixed by 4 spaces or 1 tab + pattern: /^(?: {4}|\t).+/m, + alias: 'keyword' + }, + { + // `code` + // ``code`` + pattern: /``.+?``|`[^`\n]+`/, + alias: 'keyword' + }, + { + // ```optional language + // code block + // ``` + pattern: /^```[\s\S]*?^```$/m, + greedy: true, + inside: { + 'code-block': { + pattern: /^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m, + lookbehind: true + }, + 'code-language': { + pattern: /^(```).+/, + lookbehind: true + }, + 'punctuation': /```/ + } + } + ], + 'title': [ + { + // title 1 + // ======= + + // title 2 + // ------- + pattern: /\S.*(?:\r?\n|\r)(?:==+|--+)/, + alias: 'important', + inside: { + punctuation: /==+$|--+$/ + } + }, + { + // # title 1 + // ###### title 6 + pattern: /(^\s*)#+.+/m, + lookbehind: true, + alias: 'important', + inside: { + punctuation: /^#+|#+$/ + } + } + ], + 'hr': { + // *** + // --- + // * * * + // ----------- + pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, + lookbehind: true, + alias: 'punctuation' }, - { - // ```optional language - // code block - // ``` - pattern: /^```[\s\S]*?^```$/m, - greedy: true, + 'list': { + // * item + // + item + // - item + // 1. item + pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, + lookbehind: true, + alias: 'punctuation' + }, + 'url-reference': { + // [id]: http://example.com "Optional title" + // [id]: http://example.com 'Optional title' + // [id]: http://example.com (Optional title) + // [id]: "Optional title" + pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, inside: { - 'code-block': { - pattern: /^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m, + 'variable': { + pattern: /^(!?\[)[^\]]+/, lookbehind: true }, - 'code-language': { - pattern: /^(```).+/, - lookbehind: true + 'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, + 'punctuation': /^[\[\]!:]|[<>]/ + }, + alias: 'url' + }, + 'bold': { + // **strong** + // __strong__ + + // allow one nested instance of italic text using the same delimiter + pattern: createInline(/__(?:|_(?:)+_)+__/.source, true), + lookbehind: true, + greedy: true, + inside: { + 'content': { + pattern: /(^..)[\s\S]+(?=..$)/, + lookbehind: true, + inside: {} // see below }, - 'punctuation': /```/ + 'punctuation': /\*\*|__/ } - } - ], - 'title': [ - { - // title 1 - // ======= - - // title 2 - // ------- - pattern: /\S.*(?:\r?\n|\r)(?:==+|--+)/, - alias: 'important', + }, + 'italic': { + // *em* + // _em_ + + // allow one nested instance of bold text using the same delimiter + pattern: createInline(/_(?:|__(?:)+__)+_/.source, true), + lookbehind: true, + greedy: true, inside: { - punctuation: /==+$|--+$/ + 'content': { + pattern: /(^.)[\s\S]+(?=.$)/, + lookbehind: true, + inside: {} // see below + }, + 'punctuation': /[*_]/ } }, - { - // # title 1 - // ###### title 6 - pattern: /(^\s*)#+.+/m, + 'strike': { + // ~~strike through~~ + // ~strike~ + + // extra _ is because the inner pattern intentionally doesn't include it because of bold and italic + pattern: createInline(/(~~?)(?:|_)+?\2/.source, false), lookbehind: true, - alias: 'important', + greedy: true, inside: { - punctuation: /^#+|#+$/ + 'content': { + pattern: /(^~~?)[\s\S]+(?=\1$)/, + lookbehind: true, + inside: {} // see below + }, + 'punctuation': /~~?/ } - } - ], - 'hr': { - // *** - // --- - // * * * - // ----------- - pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, - lookbehind: true, - alias: 'punctuation' - }, - 'list': { - // * item - // + item - // - item - // 1. item - pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, - lookbehind: true, - alias: 'punctuation' - }, - 'url-reference': { - // [id]: http://example.com "Optional title" - // [id]: http://example.com 'Optional title' - // [id]: http://example.com (Optional title) - // [id]: "Optional title" - pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, - inside: { - 'variable': { - pattern: /^(!?\[)[^\]]+/, - lookbehind: true - }, - 'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, - 'punctuation': /^[\[\]!:]|[<>]/ }, - alias: 'url' - }, - 'bold': { - // **strong** - // __strong__ - - // Allow only one line break - pattern: /(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/, - lookbehind: true, - greedy: true, - inside: { - 'punctuation': /^\*\*|^__|\*\*$|__$/ - } - }, - 'italic': { - // *em* - // _em_ - - // Allow only one line break - pattern: /(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/, - lookbehind: true, - greedy: true, - inside: { - 'punctuation': /^[*_]|[*_]$/ - } - }, - 'strike': { - // ~~strike through~~ - // ~strike~ - - // Allow only one line break - pattern: /(^|[^\\])(~~?)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/, - lookbehind: true, - greedy: true, - inside: { - 'punctuation': /^~~?|~~?$/ - } - }, - 'url': { - // [example](http://example.com "Optional title") - // [example] [id] - pattern: /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/, - inside: { - 'variable': { - pattern: /(!?\[)[^\]]+(?=\]$)/, - lookbehind: true - }, - 'string': { - pattern: /"(?:\\.|[^"\\])*"(?=\)$)/ + 'url': { + // [example](http://example.com "Optional title") + // [example] [id] + pattern: /!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/, + inside: { + 'variable': { + pattern: /(!?\[)[^\]]+(?=\]$)/, + lookbehind: true + }, + 'string': { + pattern: /"(?:\\.|[^"\\])*"(?=\)$)/ + } } } - } -}); - -['bold', 'italic', 'strike'].forEach(function (token) { - ['url', 'bold', 'italic', 'strike'].forEach(function (inside) { - if (token !== inside) { - Prism.languages.markdown[token].inside[inside] = Prism.languages.markdown[inside]; - } }); -}); -Prism.hooks.add('after-tokenize', function (env) { - if (env.language !== 'markdown' && env.language !== 'md') { - return; - } + ['bold', 'italic', 'strike'].forEach(function (token) { + ['url', 'bold', 'italic', 'strike'].forEach(function (inside) { + if (token !== inside) { + Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside]; + } + }); + }); - function walkTokens(tokens) { - if (!tokens || typeof tokens === 'string') { + Prism.hooks.add('after-tokenize', function (env) { + if (env.language !== 'markdown' && env.language !== 'md') { return; } - for (var i = 0, l = tokens.length; i < l; i++) { - var token = tokens[i]; - - if (token.type !== 'code') { - walkTokens(token.content); - continue; + function walkTokens(tokens) { + if (!tokens || typeof tokens === 'string') { + return; } - var codeLang = token.content[1]; - var codeBlock = token.content[3]; + for (var i = 0, l = tokens.length; i < l; i++) { + var token = tokens[i]; + + if (token.type !== 'code') { + walkTokens(token.content); + continue; + } + + /* + * Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token + * is optional. But the grammar is defined so that there is only one case we have to handle: + * + * token.content = [ + * ```, + * xxxx, + * '\n', // exactly one new lines (\r or \n or \r\n) + * ..., + * '\n', // exactly one new lines again + * ``` + * ]; + */ + + var codeLang = token.content[1]; + var codeBlock = token.content[3]; - if (codeLang && codeBlock && - codeLang.type === 'code-language' && codeBlock.type === 'code-block' && - typeof codeLang.content === 'string') { + if (codeLang && codeBlock && + codeLang.type === 'code-language' && codeBlock.type === 'code-block' && + typeof codeLang.content === 'string') { - // this might be a language that Prism does not support - var alias = 'language-' + codeLang.content.trim().split(/\s+/)[0].toLowerCase(); + // this might be a language that Prism does not support + var alias = 'language-' + codeLang.content.trim().split(/\s+/)[0].toLowerCase(); - // add alias - if (!codeBlock.alias) { - codeBlock.alias = [alias]; - } else if (typeof codeBlock.alias === 'string') { - codeBlock.alias = [codeBlock.alias, alias]; - } else { - codeBlock.alias.push(alias); + // add alias + if (!codeBlock.alias) { + codeBlock.alias = [alias]; + } else if (typeof codeBlock.alias === 'string') { + codeBlock.alias = [codeBlock.alias, alias]; + } else { + codeBlock.alias.push(alias); + } } } } - } - walkTokens(env.tokens); -}); + walkTokens(env.tokens); + }); -Prism.hooks.add('wrap', function (env) { - if (env.type !== 'code-block') { - return; - } + Prism.hooks.add('wrap', function (env) { + if (env.type !== 'code-block') { + return; + } - var codeLang = ''; - for (var i = 0, l = env.classes.length; i < l; i++) { - var cls = env.classes[i]; - var match = /language-(.+)/.exec(cls); - if (match) { - codeLang = match[1]; - break; + var codeLang = ''; + for (var i = 0, l = env.classes.length; i < l; i++) { + var cls = env.classes[i]; + var match = /language-(.+)/.exec(cls); + if (match) { + codeLang = match[1]; + break; + } } - } - var grammar = Prism.languages[codeLang]; + var grammar = Prism.languages[codeLang]; - if (!grammar) { - return; - } + if (!grammar) { + return; + } - // reverse Prism.util.encode - var code = env.content.replace(/</g, '<').replace(/&/g, '&'); + // reverse Prism.util.encode + var code = env.content.replace(/</g, '<').replace(/&/g, '&'); + + env.content = Prism.highlight(code, grammar, codeLang); + }); - env.content = Prism.highlight(code, grammar, codeLang); -}); + Prism.languages.md = Prism.languages.markdown; -Prism.languages.md = Prism.languages.markdown; +}(Prism)); diff --git a/components/prism-markdown.min.js b/components/prism-markdown.min.js index b42f979300..fd5615fdf5 100644 --- a/components/prism-markdown.min.js +++ b/components/prism-markdown.min.js @@ -1 +1 @@ -Prism.languages.markdown=Prism.languages.extend("markup",{}),Prism.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},code:[{pattern:/^(?: {4}|\t).+/m,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\r?\n|\r)(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:/(^|[^\\])(\*\*|__)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,greedy:!0,inside:{punctuation:/^\*\*|^__|\*\*$|__$/}},italic:{pattern:/(^|[^\\])([*_])(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,greedy:!0,inside:{punctuation:/^[*_]|[*_]$/}},strike:{pattern:/(^|[^\\])(~~?)(?:(?:\r?\n|\r)(?!\r?\n|\r)|.)+?\2/,lookbehind:!0,greedy:!0,inside:{punctuation:/^~~?|~~?$/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["bold","italic","strike"].forEach(function(a){["url","bold","italic","strike"].forEach(function(n){a!==n&&(Prism.languages.markdown[a].inside[n]=Prism.languages.markdown[n])})}),Prism.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(a){if(a&&"string"!=typeof a)for(var t=0,e=a.length;t/g,"\\\\.|[^\\\\\\n\r_]|(?:\r?\n|\r)(?!\r?\n|\r)"),e&&(n=n+"|"+n.replace(/_/g,"\\*")),RegExp("((?:^|[^\\\\])(?:\\\\{2})*)(?:"+n+")")}s.languages.markdown=s.languages.extend("markup",{}),s.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},code:[{pattern:/^(?: {4}|\t).+/m,alias:"keyword"},{pattern:/``.+?``|`[^`\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\r?\n|\r)(?:==+|--+)/,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n("__(?:|_(?:)+_)+__",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n("_(?:|__(?:)+__)+_",!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n("(~~?)(?:|_)+?\\2",!1),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:/!?\[[^\]]+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[[^\]\n]*\])/,inside:{variable:{pattern:/(!?\[)[^\]]+(?=\]$)/,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["bold","italic","strike"].forEach(function(e){["url","bold","italic","strike"].forEach(function(n){e!==n&&(s.languages.markdown[e].inside.content.inside[n]=s.languages.markdown[n])})}),s.hooks.add("after-tokenize",function(n){"markdown"!==n.language&&"md"!==n.language||!function n(e){if(e&&"string"!=typeof e)for(var t=0,a=e.length;t]?|>[>=]?|[+\-*\/]=?|[@^=]/, - 'punctuation': /\(\.|\.\)|[()\[\]:;,.]/ + 'punctuation': /\(\.|\.\)|[()\[\]:;,.{}]/ }; diff --git a/components/prism-pascaligo.min.js b/components/prism-pascaligo.min.js index 17a6850a48..83504e17fb 100644 --- a/components/prism-pascaligo.min.js +++ b/components/prism-pascaligo.min.js @@ -1 +1 @@ -Prism.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:[{pattern:/(?:'(?:''|[^'\r\n])*')+|\^[a-z]/i,greedy:!0},{pattern:/(?:"(?:""|[^"\r\n])*")+|\^[a-z]/i,greedy:!0}],keyword:{pattern:/(^|[^&])\b(?:begin|block|const|else|end|for|from|function|if|is|nil|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:True|False)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:int|unit|string|nat|map)\b/i,lookbehind:!0},function:{pattern:/(?!with\b)\b\w+ ?(?=\()/i},variable:{pattern:/\w+ ?(?=\:)/},"class-name":{pattern:/\w+(?=\s+is\b)/i},number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,punctuation:/\(\.|\.\)|[()\[\]:;,.]/}; \ No newline at end of file +Prism.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:[{pattern:/(?:'(?:''|[^'\r\n])*')+|\^[a-z]/i,greedy:!0},{pattern:/(?:"(?:""|[^"\r\n])*")+|\^[a-z]/i,greedy:!0}],keyword:{pattern:/(^|[^&])\b(?:begin|block|const|else|end|for|from|function|if|is|nil|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:True|False)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:int|unit|string|nat|map)\b/i,lookbehind:!0},function:{pattern:/(?!with\b)\b\w+ ?(?=\()/i},variable:{pattern:/\w+ ?(?=\:)/},"class-name":{pattern:/\w+(?=\s+is\b)/i},number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/}; \ No newline at end of file diff --git a/components/prism-pcaxis.js b/components/prism-pcaxis.js new file mode 100644 index 0000000000..1ce0ba1043 --- /dev/null +++ b/components/prism-pcaxis.js @@ -0,0 +1,53 @@ +Prism.languages.pcaxis = { + 'string': /"[^"]*"/, + 'keyword': { + pattern: /((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/, + lookbehind: true, + greedy: true, + inside: { + 'keyword': /^[-A-Z\d]+/, + 'language': { + pattern: /^(\s*)\[[-\w]+\]/, + lookbehind: true, + inside: { + 'punctuation': /^\[|\]$/, + 'property': /[-\w]+/ + } + }, + 'sub-key': { + pattern: /^(\s*)[\s\S]+/, + lookbehind: true, + inside: { + 'parameter': { + pattern: /"[^"]*"/, + alias: 'property' + }, + 'punctuation': /^\(|\)$|,/ + } + } + } + }, + 'operator': /=/, + 'tlist': { + pattern: /TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/, + greedy: true, + inside: { + 'function': /^TLIST/, + 'property': { + pattern: /^(\s*\(\s*)\w+/, + lookbehind: true + }, + 'string': /"[^"]*"/, + 'punctuation': /[(),]/, + 'operator': /-/ + } + }, + 'punctuation': /[;,]/, + 'number': { + pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/, + lookbehind: true + }, + 'boolean': /YES|NO/, +}; + +Prism.languages.px = Prism.languages.pcaxis; diff --git a/components/prism-pcaxis.min.js b/components/prism-pcaxis.min.js new file mode 100644 index 0000000000..89ef4484f6 --- /dev/null +++ b/components/prism-pcaxis.min.js @@ -0,0 +1 @@ +Prism.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)[\s\S]+/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/YES|NO/},Prism.languages.px=Prism.languages.pcaxis; \ No newline at end of file diff --git a/components/prism-protobuf.js b/components/prism-protobuf.js index 44e6cd5cad..4e369f84e9 100644 --- a/components/prism-protobuf.js +++ b/components/prism-protobuf.js @@ -1,8 +1,36 @@ -Prism.languages.protobuf = Prism.languages.extend('clike', { - keyword: /\b(?:package|import|message|enum)\b/, - builtin: /\b(?:required|repeated|optional|reserved)\b/, - primitive: { - pattern: /\b(?:double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/, - alias: 'symbol' - } -}); +(function (Prism) { + + var builtinTypes = /\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/; + + Prism.languages.protobuf = Prism.languages.extend('clike', { + 'class-name': { + pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/, + lookbehind: true + }, + 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/ + }); + + Prism.languages.insertBefore('protobuf', 'operator', { + 'map': { + pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/, + alias: 'class-name', + inside: { + 'punctuation': /[<>.,]/, + 'builtin': builtinTypes + } + }, + 'builtin': builtinTypes, + 'positional-class-name': { + pattern: /(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/, + alias: 'class-name', + inside: { + 'punctuation': /\./ + } + }, + 'annotation': { + pattern: /(\[\s*)[A-Za-z_]\w*(?=\s*=)/, + lookbehind: true + } + }); + +}(Prism)); diff --git a/components/prism-protobuf.min.js b/components/prism-protobuf.min.js index a55dbe2702..ffbdaee557 100644 --- a/components/prism-protobuf.min.js +++ b/components/prism-protobuf.min.js @@ -1 +1 @@ -Prism.languages.protobuf=Prism.languages.extend("clike",{keyword:/\b(?:package|import|message|enum)\b/,builtin:/\b(?:required|repeated|optional|reserved)\b/,primitive:{pattern:/\b(?:double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,alias:"symbol"}}); \ No newline at end of file +!function(e){var a=/\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:a}},builtin:a,"positional-class-name":{pattern:/(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[A-Za-z_]\w*(?=\s*=)/,lookbehind:!0}})}(Prism); \ No newline at end of file diff --git a/download.html b/download.html index abd58cabac..c8e0bf9af5 100644 --- a/download.html +++ b/download.html @@ -107,7 +107,6 @@ } #download pre { height: 20em; - word-wrap: break-word; } #download .download-button { cursor: pointer; diff --git a/examples/prism-actionscript.html b/examples/prism-actionscript.html index abb5804dbb..9ef3987ead 100644 --- a/examples/prism-actionscript.html +++ b/examples/prism-actionscript.html @@ -93,7 +93,7 @@

Full example

var gradientBmp:BitmapData = new BitmapData(256, 10, false, 0); gradientBmp.draw(gradient); RLUT = new Array(); GLUT = new Array(); BLUT = new Array(); - for (var i:int = 0; i < 256; i++) { + for (var i:int = 0; i < 256; i++) { var pixelColor:uint = gradientBmp.getPixel(i, 0); //I drew the gradient backwards, so sue me RLUT[256-i] = pixelColor & 0xff0000; @@ -130,4 +130,4 @@

Full example

colorBmp.paletteMap(sourceBmp, sourceBmp.rect, O, RLUT, GLUT, BLUT, null); } } -} \ No newline at end of file +} diff --git a/examples/prism-applescript.html b/examples/prism-applescript.html index c88390e819..9567b87148 100644 --- a/examples/prism-applescript.html +++ b/examples/prism-applescript.html @@ -24,18 +24,3 @@

Classes and units

set averageTemp to 63 as degrees Fahrenheit set circleArea to (pi * 7 * 7) as square yards - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Comments only support one level of nesting

-
(* Nested block
-	(* comments
-		(* on more than
-		2 levels *)
-	are *)
-not supported *)
\ No newline at end of file diff --git a/examples/prism-arduino.html b/examples/prism-arduino.html index 915f700f48..cc96f2657e 100644 --- a/examples/prism-arduino.html +++ b/examples/prism-arduino.html @@ -14,7 +14,7 @@

Booleans

false;

Operators

-
a < b;
+
a < b;
 c && d;

Full example

@@ -28,7 +28,7 @@

Full example

* runs once before everyhing else */ void setup() { - pinMode(piezo, OUTPUT); + pinMode(piezo, OUTPUT); } /** diff --git a/examples/prism-asciidoc.html b/examples/prism-asciidoc.html index d6df3021b5..bd2aedfc84 100644 --- a/examples/prism-asciidoc.html +++ b/examples/prism-asciidoc.html @@ -88,7 +88,7 @@

Tables

[cols="e,m,^,>s",width="25%"]
 |============================
 |1 >s|2 |3 |4
-^|5 2.2+^.^|6 .3+<.>m|7
+^|5 2.2+^.^|6 .3+<.>m|7
 ^|8
 |9 2+>|10
 |============================
@@ -101,4 +101,4 @@

Inline styles

Attribute entries

:Author Initials: JB
 {authorinitials}
-:Author Initials!:
\ No newline at end of file +:Author Initials!:
diff --git a/examples/prism-aspnet.html b/examples/prism-aspnet.html index d9c30fcf96..d65a84d85e 100644 --- a/examples/prism-aspnet.html +++ b/examples/prism-aspnet.html @@ -1,17 +1,17 @@

Comments

-
<%-- This is a comment --%>
-<%-- This is a
+
<%-- This is a comment --%>
+<%-- This is a
 multi-line comment --%>

Page directives

-
<%@ Page Title="Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"  CodeBehind="ProductList.aspx.cs" Inherits="WingtipToys.ProductList" %>
+
<%@ Page Title="Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"  CodeBehind="ProductList.aspx.cs" Inherits="WingtipToys.ProductList" %>
 

Directive tag

-
<%: Page.Title %>
-<a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>">
+
<%: Page.Title %>
+<a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>">
 <span>
-    <%#:Item.ProductName%>
+	<%#:Item.ProductName%>
 </span>

Highlighted C# inside scripts

@@ -19,18 +19,18 @@

Highlighted C# inside scripts

On this page, check C# before checking ASP.NET should make the example below work properly.

<script runat="server">
-    // The following variables are visible to all procedures
-    // within the script block.
-    String str;
-    int i;
-    int i2;
+	// The following variables are visible to all procedures
+	// within the script block.
+	String str;
+	int i;
+	int i2;
 
-    int DoubleIt(int inpt)
-    {
-        // The following variable is visible only within
-        // the DoubleIt procedure.
-        int factor = 2;
+	int DoubleIt(int inpt)
+	{
+		// The following variable is visible only within
+		// the DoubleIt procedure.
+		int factor = 2;
 
-        return inpt * factor;
-    }
-</script>
\ No newline at end of file + return inpt * factor; + } +</script>
diff --git a/examples/prism-autohotkey.html b/examples/prism-autohotkey.html index 620edb2eab..3e7ced7064 100644 --- a/examples/prism-autohotkey.html +++ b/examples/prism-autohotkey.html @@ -19,7 +19,7 @@

Full example

return if f_class = #32770 ; It's a dialog. { - if f_Edit1Pos <> ; And it has an Edit1 control. + if f_Edit1Pos <> ; And it has an Edit1 control. { ; Activate the window so that if the user is middle-clicking ; outside the dialog, subsequent clicks will also work: @@ -37,7 +37,7 @@

Full example

} else if f_class in ExploreWClass,CabinetWClass ; In Explorer, switch folders. { - if f_Edit1Pos <> ; And it has an Edit1 control. + if f_Edit1Pos <> ; And it has an Edit1 control. { ControlSetText, Edit1, %f_path%, ahk_id %f_window_id% ; Tekl reported the following: "If I want to change to Folder L:\folder @@ -65,4 +65,4 @@

Full example

; 2) It's a supported type but it lacks an Edit1 control to facilitate the custom ; action, so instead do the default action below. Run, Explorer %f_path% ; Might work on more systems without double quotes. -return
\ No newline at end of file +return
diff --git a/examples/prism-autoit.html b/examples/prism-autoit.html index 51220b421c..be283a4473 100644 --- a/examples/prism-autoit.html +++ b/examples/prism-autoit.html @@ -36,17 +36,3 @@

Keywords and variables

EndIf MsgBox($MB_SYSTEMMODAL, "", "The value of $i is: " & $i) Next - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested block comments

-
#cs
-	#cs
-		foo()
-	#ce
-#ce
\ No newline at end of file diff --git a/examples/prism-bash.html b/examples/prism-bash.html index 3e0febfaba..5cf56d1b59 100644 --- a/examples/prism-bash.html +++ b/examples/prism-bash.html @@ -21,7 +21,7 @@

Variables

echo ${args[0]} ${args[1]} ${args[2]}

Keywords

-
for (( i=0;i<$ELEMENTS;i++)); do
+
for (( i=0;i<$ELEMENTS;i++)); do
 	echo ${ARRAY[${i}]}
 done
 while read LINE; do
@@ -46,4 +46,4 @@ 

Some well-known commands

git pull origin master -sudo gpg --refresh-keys; sudo apt-key update; sudo rm -rf /var/lib/apt/{lists,lists.old}; sudo mkdir -p /var/lib/apt/lists/partial; sudo apt-get clean all; sudo apt-get update
\ No newline at end of file +sudo gpg --refresh-keys; sudo apt-key update; sudo rm -rf /var/lib/apt/{lists,lists.old}; sudo mkdir -p /var/lib/apt/lists/partial; sudo apt-get clean all; sudo apt-get update
diff --git a/examples/prism-basic.html b/examples/prism-basic.html index 3630a8a2c0..241a0571aa 100644 --- a/examples/prism-basic.html +++ b/examples/prism-basic.html @@ -57,7 +57,7 @@

QuickBASIC example

CALL PrintSomeStars(NumStars) DO INPUT "Do you want more stars? ", Answer$ - LOOP UNTIL Answer$ <> "" + LOOP UNTIL Answer$ <> "" Answer$ = LEFT$(Answer$, 1) LOOP WHILE UCASE$(Answer$) = "Y" PRINT "Goodbye "; UserName$ @@ -66,4 +66,4 @@

QuickBASIC example

REM This procedure uses a local variable called Stars$ Stars$ = STRING$(StarCount, "*") PRINT Stars$ -END SUB \ No newline at end of file +END SUB diff --git a/examples/prism-bison.html b/examples/prism-bison.html index 9c7edeb8da..a4ccf8dd64 100644 --- a/examples/prism-bison.html +++ b/examples/prism-bison.html @@ -50,7 +50,7 @@

Full example

string* op_val; } -%start input +%start input %token <int_val> INTEGER_LITERAL %type <int_val> exp @@ -74,7 +74,7 @@

Full example

{ extern int yylineno; // defined and maintained in lex.c extern char *yytext; // defined and maintained in lex.c - + cerr << "ERROR: " << s << " at symbol \"" << yytext; cerr << "\" on line " << yylineno << endl; exit(1); @@ -84,21 +84,3 @@

Full example

{ return yyerror(string(s)); } - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Two levels of nesting inside C section

-
{
-	if($1) {
-		if($2) {
-
-		}
-	}
-} // <- Broken
-%%
-%%
\ No newline at end of file diff --git a/examples/prism-brainfuck.html b/examples/prism-brainfuck.html index 89a435c92f..d47a974406 100644 --- a/examples/prism-brainfuck.html +++ b/examples/prism-brainfuck.html @@ -7,15 +7,15 @@

Full example

>+++ Add 3 to Cell #3 >+++ Add 3 to Cell #4 >+ Add 1 to Cell #5 - <<<<- Decrement the loop counter in Cell #1 + <<<<- Decrement the loop counter in Cell #1 ] Loop till Cell #1 is zero; number of iterations is 4 >+ Add 1 to Cell #2 >+ Add 1 to Cell #3 >- Subtract 1 from Cell #4 >>+ Add 1 to Cell #6 - [<] Move back to the first zero cell you find; this will + [<] Move back to the first zero cell you find; this will be Cell #1 which was cleared by the previous loop - <- Decrement the loop Counter in Cell #0 + <- Decrement the loop Counter in Cell #0 ] Loop till Cell #0 is zero; number of iterations is 8 The result of this is: @@ -27,11 +27,11 @@

Full example

>---. Subtract 3 from Cell #3 to get 101 which is 'e' +++++++..+++. Likewise for 'llo' from Cell #3 >>. Cell #5 is 32 for the space -<-. Subtract 1 from Cell #4 for 87 to give a 'W' -<. Cell #3 was set to 'o' from the end of 'Hello' +<-. Subtract 1 from Cell #4 for 87 to give a 'W' +<. Cell #3 was set to 'o' from the end of 'Hello' +++.------.--------. Cell #3 for 'rl' and 'd' >>+. Add 1 to Cell #5 gives us an exclamation point >++. And finally a newline from Cell #6

One-line example

-
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
+
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
diff --git a/examples/prism-bro.html b/examples/prism-bro.html index 83d6374e67..d7645c6db5 100644 --- a/examples/prism-bro.html +++ b/examples/prism-bro.html @@ -300,7 +300,7 @@

Full example

# because c might not correspond to an active connection (which # causes the function to fail). if ( suppress_UDP_scan_checks && - service >= 0/udp && service <= 65535/udp ) + service >= 0/udp && service <= 65535/udp ) return F; if ( service in skip_services && ! outbound ) @@ -343,8 +343,8 @@

Full example

empty_bs_table; } - if ( ++distinct_backscatter_peers[orig][resp] <= 2 && - # The test is <= 2 because we get two check_scan() + if ( ++distinct_backscatter_peers[orig][resp] <= 2 && + # The test is <= 2 because we get two check_scan() # calls, once on connection attempt and once on # tear-down. @@ -380,7 +380,7 @@

Full example

pre_distinct_peers[orig] = set(); add pre_distinct_peers[orig][resp]; - if ( |pre_distinct_peers[orig]| < addr_scan_trigger ) + if ( |pre_distinct_peers[orig]| < addr_scan_trigger ) ignore = T; } @@ -462,7 +462,7 @@

Full example

} # Check for low ports. - if ( activate_priv_port_check && ! outbound && service < 1024/tcp && + if ( activate_priv_port_check && ! outbound && service < 1024/tcp && service !in troll_skip_service ) { if ( orig !in distinct_low_ports || @@ -559,7 +559,7 @@

Full example

return F; } - if ( idx[orig] <= |v| && n >= v[idx[orig]] ) + if ( idx[orig] <= |v| && n >= v[idx[orig]] ) { ++idx[orig]; return T; @@ -578,7 +578,7 @@

Full example

return F; } - if ( idx[orig,resp] <= |v| && n >= v[idx[orig, resp]] ) + if ( idx[orig,resp] <= |v| && n >= v[idx[orig, resp]] ) { ++idx[orig,resp]; return T; @@ -642,4 +642,4 @@

Full example

for ( orig in distinct_low_ports ) lowport_summary(distinct_low_ports, orig); } - \ No newline at end of file + diff --git a/examples/prism-c.html b/examples/prism-c.html index aee1c06a87..635b01fd5d 100644 --- a/examples/prism-c.html +++ b/examples/prism-c.html @@ -16,7 +16,7 @@

Full example

{ int c; printf("Number of command line arguments passed: %d\n", argc); - for ( c = 0 ; c < argc ; c++) + for ( c = 0 ; c < argc ; c++) printf("%d. Command line argument passed is %s\n", c+1, argv[c]); return 0; -} \ No newline at end of file +} diff --git a/examples/prism-clojure.html b/examples/prism-clojure.html index abc50194b3..4dd511816f 100644 --- a/examples/prism-clojure.html +++ b/examples/prism-clojure.html @@ -255,8 +255,8 @@

Full example

; The "Thread-first" macro (->) inserts into each form the result of ; the previous, as the first argument (second item) -(-> - {:a 1 :b 2} +(-> + {:a 1 :b 2} (assoc :c 3) ;=> (assoc {:a 1 :b 2} :c 3) (dissoc :b)) ;=> (dissoc (assoc {:a 1 :b 2} :c 3) :b) @@ -275,7 +275,7 @@

Full example

; Result: [1 3 5 7 9] ; When you are in a situation where you want more freedom as where to -; put the result of previous data transformations in an +; put the result of previous data transformations in an ; expression, you can use the as-> macro. With it, you can assign a ; specific name to transformations' output and use it as a ; placeholder in your chained expressions: @@ -365,7 +365,7 @@

Full example

(swap! my-atom assoc :b 2) ; Sets my-atom to the result of (assoc {:a 1} :b 2) ; Use '@' to dereference the atom and get the value -my-atom ;=> Atom<#...> (Returns the Atom object) +my-atom ;=> Atom<#...> (Returns the Atom object) @my-atom ; => {:a 1 :b 2} ; Here's a simple counter using an atom @@ -383,4 +383,4 @@

Full example

; Other STM constructs are refs and agents. ; Refs: http://clojure.org/refs -; Agents: http://clojure.org/agents \ No newline at end of file +; Agents: http://clojure.org/agents diff --git a/examples/prism-cpp.html b/examples/prism-cpp.html index 32bdcbda56..f0fa1d3d20 100644 --- a/examples/prism-cpp.html +++ b/examples/prism-cpp.html @@ -32,7 +32,7 @@

Full example

vector<int> left, vector<int> right ){ - if( (left[5]) < (right[5]) ){ + if( (left[5]) < (right[5]) ){ return( right ); }; // else @@ -40,18 +40,18 @@

Full example

} int vector_demo(void){ - cout << "vector demo" << endl; + cout << "vector demo" << endl; vector<int> left(7); vector<int> right(7); left[5] = 7; right[5] = 8; - cout << left[5] << endl; - cout << right[5] << endl; + cout << left[5] << endl; + cout << right[5] << endl; vector<int> biggest( pick_vector_with_biggest_fifth_element( left, right ) ); - cout << biggest[5] << endl; + cout << biggest[5] << endl; return 0; } diff --git a/examples/prism-d.html b/examples/prism-d.html index d4bf34cc8c..9ef1d6c78a 100644 --- a/examples/prism-d.html +++ b/examples/prism-d.html @@ -252,16 +252,3 @@

Full example

assert(_totalc >= _argc); } } - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Comments only support one level of nesting

-
/+ /+ /+ this does not work +/ +/ +/
- -

Token strings only support one level of nesting

-
q{ q{ q{ this does not work } } }
\ No newline at end of file diff --git a/examples/prism-elixir.html b/examples/prism-elixir.html index 7112fbca5b..df4426be74 100644 --- a/examples/prism-elixir.html +++ b/examples/prism-elixir.html @@ -450,13 +450,3 @@

Full example

# The shell is also a process, you can use `self` to get the current pid self() #=> #PID<0.27.0> - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

String interpolation in single-quoted strings

-
'#{:atom} <- this should not be highligted'
\ No newline at end of file diff --git a/examples/prism-gml.html b/examples/prism-gml.html index a1649f6b68..5526c5cd3a 100644 --- a/examples/prism-gml.html +++ b/examples/prism-gml.html @@ -8,7 +8,7 @@

Functions

Full example

if(instance_exists(_inst) || _inst==global){
-	if(_delay<=0){
+	if(_delay<=0){
 		_time+=1;
 		if(_time<_duration){
 			event_user(0);
diff --git a/examples/prism-go.html b/examples/prism-go.html
index 205a1a7e29..da2bc7f931 100644
--- a/examples/prism-go.html
+++ b/examples/prism-go.html
@@ -41,7 +41,7 @@ 

Runes and strings

string"

Functions

-
func(a, b int, z float64) bool { return a*b < int(z) }
+
func(a, b int, z float64) bool { return a*b < int(z) }

Full example

package main
@@ -52,7 +52,7 @@ 

Full example

for _, v := range a { sum += v } - c <- sum // send sum to c + c <- sum // send sum to c } func main() { @@ -61,8 +61,8 @@

Full example

c := make(chan int) go sum(a[:len(a)/2], c) go sum(a[len(a)/2:], c) - x, y := <-c, <-c // receive from c + x, y := <-c, <-c // receive from c fmt.Println(x, y, x+y) } -
\ No newline at end of file + diff --git a/examples/prism-groovy.html b/examples/prism-groovy.html index 3ec1d6d39b..ac36cf7e53 100644 --- a/examples/prism-groovy.html +++ b/examples/prism-groovy.html @@ -81,13 +81,3 @@

Full example

assert 4 / 2 == 2 } } - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Two divisions on the same line

-
2 / 3 / 4
\ No newline at end of file diff --git a/examples/prism-haml.html b/examples/prism-haml.html index c2cc670c32..364595ad01 100644 --- a/examples/prism-haml.html +++ b/examples/prism-haml.html @@ -21,7 +21,7 @@

Tags

%html{html_attrs('fr-fr')} %div[@user, :greeting] %img -%pre>< +%pre>< foo bar %img @@ -76,4 +76,4 @@

Filters

the example below work properly.

%script
   :coffee
-    console.log 'This is coffee script'
\ No newline at end of file + console.log 'This is coffee script' diff --git a/examples/prism-handlebars.html b/examples/prism-handlebars.html index c39c8b742d..8e07329166 100644 --- a/examples/prism-handlebars.html +++ b/examples/prism-handlebars.html @@ -29,13 +29,3 @@

Block helpers

This should probably work... {{/block-with-hyphens}} - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Handlebars tag in the middle of an HTML tag

-
<div{{#if test}} class="test"{{/if}}></div>
diff --git a/examples/prism-haskell.html b/examples/prism-haskell.html index de58eb79bf..799bbdfa79 100644 --- a/examples/prism-haskell.html +++ b/examples/prism-haskell.html @@ -28,7 +28,7 @@

Full example

wantReadableHandle_ "Data.ByteString.hGetLine" h $ \ h_@Handle__{haByteBuffer} -> do flushCharReadBuffer h_ - buf <- readIORef haByteBuffer + buf <- readIORef haByteBuffer if isEmptyBuffer buf then fill h_ buf 0 [] else haveBuf h_ buf 0 [] @@ -36,7 +36,7 @@

Full example

fill h_@Handle__{haByteBuffer,haDevice} buf len xss = len `seq` do - (r,buf') <- Buffered.fillReadBuffer haDevice buf + (r,buf') <- Buffered.fillReadBuffer haDevice buf if r == 0 then do writeIORef haByteBuffer buf{ bufR=0, bufL=0 } if len > 0 @@ -48,9 +48,9 @@

Full example

buf@Buffer{ bufRaw=raw, bufR=w, bufL=r } len xss = do - off <- findEOL r w raw + off <- findEOL r w raw let new_len = len + off - r - xs <- mkPS raw r off + xs <- mkPS raw r off -- if eol == True, then off is the offset of the '\n' -- otherwise off == w and the buffer is now empty. @@ -66,7 +66,7 @@

Full example

findEOL r w raw | r == w = return w | otherwise = do - c <- readWord8Buf raw r + c <- readWord8Buf raw r if c == fromIntegral (ord '\n') then return r -- NB. not r+1: don't include the '\n' else findEOL (r+1) w raw @@ -77,4 +77,4 @@

Full example

withRawBuffer buf $ \pbuf -> do copyBytes p (pbuf `plusPtr` start) len where - len = end - start \ No newline at end of file + len = end - start diff --git a/examples/prism-inform7.html b/examples/prism-inform7.html index 9e2214f01d..d4c3b746e1 100644 --- a/examples/prism-inform7.html +++ b/examples/prism-inform7.html @@ -159,13 +159,3 @@

Full example

Instead of taking off the outfit: say "What odd ideas come into your head sometimes!" Test me with "fill glass / empty absinthe into lake / fill glass / swim / drink lake / drink / x water / x lake". - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Names starting with a number

-
The box 1A is a container
\ No newline at end of file diff --git a/examples/prism-j.html b/examples/prism-j.html index cf4c109afa..0227e31fd0 100644 --- a/examples/prism-j.html +++ b/examples/prism-j.html @@ -34,7 +34,7 @@

Examples

NB. multiply a row by a constant, NB. and add a multiple of one row to another: -E1=: <@] C. [ +E1=: <@] C. [ E2=: f`g`[} E3=: F`g`[} f=: {:@] * {.@] { [ @@ -56,4 +56,4 @@

Examples

NB. Implementation of quicksort (tacit programming)
 
-quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)
\ No newline at end of file +quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#) diff --git a/examples/prism-java.html b/examples/prism-java.html index 691a6b10ec..277a1ab12b 100644 --- a/examples/prism-java.html +++ b/examples/prism-java.html @@ -39,8 +39,8 @@

Full example

public static boolean[][] gen(){ boolean[][] grid = new boolean[10][10]; - for(int r = 0; r < 10; r++) - for(int c = 0; c < 10; c++) + for(int r = 0; r < 10; r++) + for(int c = 0; c < 10; c++) if( Math.random() > 0.7 ) grid[r][c] = true; return grid; diff --git a/examples/prism-javascript.html b/examples/prism-javascript.html index 35ccf7d0bb..f073b65de0 100644 --- a/examples/prism-javascript.html +++ b/examples/prism-javascript.html @@ -64,17 +64,3 @@

ES6 features

multiple lines.` `40 + 2 = ${ 40 + 2 }` `The squares of the first 3 natural integers are ${[for (x of [1,2,3]) x*x].join(', ')}` - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

String interpolation containing a closing brace

-
`${ /* } */ a + b }`
-`${ '}' }`
- -

String interpolation with deeply nested braces

-
`${foo({ a: { b: { c: true } } })}`
diff --git a/examples/prism-jolie.html b/examples/prism-jolie.html index 8d23d995ab..9a35b009e1 100644 --- a/examples/prism-jolie.html +++ b/examples/prism-jolie.html @@ -60,7 +60,7 @@

Full example

OneWay: *(AuthenticationData) } -service SubService +service SubService { Interfaces: NetInterface @@ -92,9 +92,9 @@

Full example

.debug.showContent = true } Interfaces: NetInterface - Aggregates: SubService, + Aggregates: SubService, LoggerService - Redirects: A => SubService, + Redirects: A => SubService, B => SubService } @@ -105,11 +105,11 @@

Full example

execution{ concurrent } define netmodule { - if( request.load == 0 || request.load < 1 && - request.load <= 2 || request.load >= 3 && + if( request.load == 0 || request.load < 1 && + request.load <= 2 || request.load >= 3 && request.load > 4 || request.load%4 == 2 ) { - scope( scopeName ) { + scope( scopeName ) { // inline comment install( MyFault => println@Console( "Something \"Went\" Wrong" + ' but it\'s ok' )() ); /* @@ -127,9 +127,9 @@

Full example

with( node ){ while( .load != 100 ) { .load++ - } + } } - } + } } } @@ -159,4 +159,4 @@

Full example

} until [ quit() ]{ exit } -} \ No newline at end of file +} diff --git a/examples/prism-less.html b/examples/prism-less.html index db8a5e6411..56f0562177 100644 --- a/examples/prism-less.html +++ b/examples/prism-less.html @@ -48,23 +48,3 @@

Interpolation

@{property}: #0ee; background-@{property}: #999; } - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

At-rules looking like variables

-
@import "some file.less";
- -

At-rules containing interpolation

-
@import "@{themes}/tidal-wave.less";
- -

extend is not highlighted consistently

-
nav ul {
-  &:extend(.inline);
-  background: blue;
-}
-.a:extend(.b) {}
\ No newline at end of file diff --git a/examples/prism-lua.html b/examples/prism-lua.html index 288b7675a4..9c18b9d068 100644 --- a/examples/prism-lua.html +++ b/examples/prism-lua.html @@ -77,13 +77,3 @@

Full example

io.write(line1(i), line2(i), line3(i - 1), "\n") end end - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Functions with a single string parameter not using parentheses are not highlighted

-
foobar"param";
diff --git a/examples/prism-makefile.html b/examples/prism-makefile.html index 45f6f420ff..fd74713a89 100644 --- a/examples/prism-makefile.html +++ b/examples/prism-makefile.html @@ -19,7 +19,7 @@

Variables

$(objects) : defs.h -%oo: $$< $$^ $$+ $$* +%oo: $$< $$^ $$+ $$* foo : bar/lose cd $(@D) && gobble $(@F) > ../$@ @@ -260,4 +260,4 @@

Complete example

> tmp.dir/$$X ; done cd tmp.dir ; zoo aM ../tar.zoo * -rm -rf tmp.dir - \ No newline at end of file + diff --git a/examples/prism-markdown.html b/examples/prism-markdown.html index a57eaeafc3..ea44fea4a6 100644 --- a/examples/prism-markdown.html +++ b/examples/prism-markdown.html @@ -67,20 +67,3 @@

Raw HTML

> Containing <strong>raw HTML</strong> <p>*Italic text inside HTML tag*</p> - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nesting of elements is not fully supported

-
_ **bold** inside italic DOESN'T work _
-__ but *italic* inside bold DOES work __
-
-[Link partially *italic* DOESN'T work](http://example.com)
-_ [But link inside italic DOES work](http://example.com) _
-
-[Link partially **bold** DOESN'T work](http://example.com)
-__ [But link inside bold DOES work](http://example.com) __
\ No newline at end of file diff --git a/examples/prism-matlab.html b/examples/prism-matlab.html index e78abe3612..790d71c125 100644 --- a/examples/prism-matlab.html +++ b/examples/prism-matlab.html @@ -40,7 +40,7 @@

Control flow

end n = 1; nFactorial = 1; -while nFactorial < 1e100 +while nFactorial < 1e100 n = n + 1; nFactorial = nFactorial * n; end @@ -49,4 +49,4 @@

Functions

q = integral(sqr,0,1);
 y = parabola(x)
 mygrid = @(x,y) ndgrid((-x:x/c:x),(-y:y/c:y));
-[x,y] = mygrid(pi,2*pi);
\ No newline at end of file +[x,y] = mygrid(pi,2*pi); diff --git a/examples/prism-mel.html b/examples/prism-mel.html index e887975657..eaf3ba517f 100644 --- a/examples/prism-mel.html +++ b/examples/prism-mel.html @@ -28,14 +28,14 @@

Arrays, vectors and matrices

print($array[1]); // Prints "second\n" print($array[2]); // Prints "third\n" -vector $roger = <<3.0, 7.7, 9.1>>; -vector $more = <<4.5, 6.789, 9.12356>>; +vector $roger = <<3.0, 7.7, 9.1>>; +vector $more = <<4.5, 6.789, 9.12356>>; // Assign a vector to variable $test: -vector $test = <<3.0, 7.7, 9.1>>; -$test = <<$test.x, 5.5, $test.z>> -// $test is now <<3.0, 5.5, 9.1>> +vector $test = <<3.0, 7.7, 9.1>>; +$test = <<$test.x, 5.5, $test.z>> +// $test is now <<3.0, 5.5, 9.1>> -matrix $a3[3][4] = <<2.5, 4.5, 3.25, 8.05; +matrix $a3[3][4] = <<2.5, 4.5, 3.25, 8.05; 1.12, 1.3, 9.5, 5.2; 7.23, 6.006, 2.34, 4.67>> @@ -82,7 +82,7 @@

Full example

// Check for negative $frames. This indicates // $silent mode. // - if ($frames < 0) + if ($frames < 0) { $silent = 1; $frames = -$frames; @@ -102,7 +102,7 @@

Full example

$startTime = `timerX`; // play -wait; int $i; - for ($i = 1; $i < $frames; $i++ ) + for ($i = 1; $i < $frames; $i++ ) { // Set time // @@ -110,7 +110,7 @@

Full example

int $obj; // Request count for every particle object. // - for ($obj = 0; $obj < $particleCount; $obj++) + for ($obj = 0; $obj < $particleCount; $obj++) { string $cmd = "getAttr " + $particleObjects[$obj]+".count"; eval( $cmd ); @@ -118,7 +118,7 @@

Full example

// Request position for every transform // (includes every rigid body). // - for ($obj = 0; $obj < $trCount; $obj++) + for ($obj = 0; $obj < $trCount; $obj++) { string $cmd = "getAttr " + $transforms[$obj]+".translate"; eval ($cmd); @@ -134,4 +134,4 @@

Full example

print( "Playback $rate: " + $rate + " $frames/sec\n" ); } return ( $rate ); -} // timePlayback // \ No newline at end of file +} // timePlayback // diff --git a/examples/prism-mizar.html b/examples/prism-mizar.html index 98d626c02f..044c5c3fe9 100644 --- a/examples/prism-mizar.html +++ b/examples/prism-mizar.html @@ -11,14 +11,14 @@

Full example

begin P: for k being Nat - st for n being Nat st n < k holds Fib (n+1) ≥ n + st for n being Nat st n < k holds Fib (n+1) ≥ n holds Fib (k+1) ≥ k proof let k be Nat; assume -IH: for n being Nat st n < k holds Fib (n+1) ≥ n; +IH: for n being Nat st n < k holds Fib (n+1) ≥ n; per cases; suppose k ≤ 1; then k = 0 or k = 0+1 by CQC_THE1:2; hence Fib (k+1) ≥ k by PRE_FF:1; - suppose 1 < k; then + suppose 1 < k; then 1+1 ≤ k by NAT_1:38; then consider m being Nat such that A: k = 1+1+m by NAT_1:28; @@ -33,8 +33,8 @@

Full example

m ≥ 1 by NAT_1:38; then B: m+(m+1) ≥ m+1+1 by REAL_1:49; C: k = m+1+1 by A, AXIOMS:13; - m < m+1 & m+1 < m+1+1 by REAL_1:69; then - m < k & m+1 < k by C, AXIOMS:22; then + m < m+1 & m+1 < m+1+1 by REAL_1:69; then + m < k & m+1 < k by C, AXIOMS:22; then D: Fib (m+1) ≥ m & Fib (m+1+1) ≥ m+1 by IH; Fib (m+1+1+1) = Fib (m+1) + Fib (m+1+1) by PRE_FF:1; then Fib (m+1+1+1) ≥ m+(m+1) by D, REAL_1:55; @@ -42,4 +42,4 @@

Full example

end; end; -for n being Nat holds Fib(n+1) ≥ n from Comp_Ind(P); \ No newline at end of file +for n being Nat holds Fib(n+1) ≥ n from Comp_Ind(P); diff --git a/examples/prism-nasm.html b/examples/prism-nasm.html index c1b7c926e3..e76146dfb7 100644 --- a/examples/prism-nasm.html +++ b/examples/prism-nasm.html @@ -57,18 +57,3 @@

Numbers

dt 3.141592653589793238462 ; pi do 1.e+4000 ; IEEE 754r quad precision - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Numbers with underscores

-
mov     ax,1100_1000b
-mov     ax,1100_1000y
-mov     ax,0b1100_1000
-mov     ax,0y1100_1000
-
-dd    1.222_222_222
\ No newline at end of file diff --git a/examples/prism-nim.html b/examples/prism-nim.html index c661125918..80296fb6ad 100644 --- a/examples/prism-nim.html +++ b/examples/prism-nim.html @@ -176,7 +176,7 @@

Full example

# Empty # OfInherit # Ident !"RootObj" - # Empty <= We want to replace this + # Empty <= We want to replace this # MethodDef # ... @@ -219,4 +219,4 @@

Full example

for a in animals: echo a.vocalize() - echo a.age_human_yrs() \ No newline at end of file + echo a.age_human_yrs() diff --git a/examples/prism-ocaml.html b/examples/prism-ocaml.html index 0534b1d165..46ee6dc831 100644 --- a/examples/prism-ocaml.html +++ b/examples/prism-ocaml.html @@ -44,16 +44,16 @@

Full example

match t with | Empty -> false | Interval (l,h) -> - Endpoint.compare x l >= 0 && Endpoint.compare x h <= 0 + Endpoint.compare x l >= 0 && Endpoint.compare x h <= 0 (** [intersect t1 t2] returns the intersection of the two input intervals *) let intersect t1 t2 = - let min x y = if Endpoint.compare x y <= 0 then x else y in + let min x y = if Endpoint.compare x y <= 0 then x else y in let max x y = if Endpoint.compare x y >= 0 then x else y in match t1,t2 with | Empty, _ | _, Empty -> Empty | Interval (l1,h1), Interval (l2,h2) -> create (max l1 l2) (min h1 h2) - end ;; \ No newline at end of file + end ;; diff --git a/examples/prism-opencl.html b/examples/prism-opencl.html index f901230bba..8431fb9d8d 100644 --- a/examples/prism-opencl.html +++ b/examples/prism-opencl.html @@ -52,11 +52,11 @@

OpenCL kernel code

// Image patch is row-wise accessed // Filter kernel is centred in the middle #pragma unroll - for (int y = -ROWS_HALF_3x3; y <= ROWS_HALF_3x3; ++y) // Start at the top left corner of the filter + for (int y = -ROWS_HALF_3x3; y <= ROWS_HALF_3x3; ++y) // Start at the top left corner of the filter { coordCurrent.y = coordBase.y + y; #pragma unroll - for (int x = -COLS_HALF_3x3; x <= COLS_HALF_3x3; ++x) // And end at the bottom right corner + for (int x = -COLS_HALF_3x3; x <= COLS_HALF_3x3; ++x) // And end at the bottom right corner { coordCurrent.x = coordBase.x + x; coordBorder = borderCoordinate(coordCurrent, rows, cols, border); diff --git a/examples/prism-parser.html b/examples/prism-parser.html index 4b4e9c0d81..c2fc79e570 100644 --- a/examples/prism-parser.html +++ b/examples/prism-parser.html @@ -67,22 +67,4 @@

Full example

# new functionality @remove[iOffset;iLimit] $iLimit(^iLimit.int(0)) -$t[^t.select(^t.offset[]<$iOffset || ^t.offset[]>=$iOffset+$iLimit)] - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Code block starting with a comment

-
# Doesn't work
-# Does work
-
 # Does work when prefixed with a space
- -

Comments inside expressions break literals and operators

-
^if(
-    $age>=4  # not too young
-    && $age<=80  # and not too old
-)
\ No newline at end of file +$t[^t.select(^t.offset[]<$iOffset || ^t.offset[]>=$iOffset+$iLimit)] diff --git a/examples/prism-pcaxis.html b/examples/prism-pcaxis.html new file mode 100644 index 0000000000..59ab31141d --- /dev/null +++ b/examples/prism-pcaxis.html @@ -0,0 +1,35 @@ +

Full example

+
CHARSET="ANSI";
+AXIS-VERSION="2000";
+LANGUAGE="en";
+CREATION-DATE="20170406 11:08";
+TIMEVAL("time")=TLIST(A1, "1994"-"1996");
+SUBJECT-AREA="";
+UNITS="Number";
+
+STUB="County","Sex";
+VALUES("County")="State","Carlow","Dublin","Kildare","Kilkenny","Laois","Longford","Louth","Meath","Offaly","Westmeath","Wexford",
+"Wicklow","Clare","Cork","Kerry","Limerick","Tipperary","Waterford","Galway","Leitrim","Mayo","Roscommon","Sligo","Cavan",
+"Donegal","Monaghan";
+VALUES("Sex")="Both sexes","Male","Female";
+VALUES[de]("Sex")="Beide Geschlechter","Mann","Frau";
+CODES("County")="-","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26";
+CODES("Sex")="-","1","2";
+
+DATA=
+47163 87913 70192 84531 93120 343 5911 47038 51126 47870 95976 5643 66043 38987 63125 46882
+57422 89992 11661 35817 92686 21781 37230 80669 14129 56688 81300 20184 88680 52135 17148 28192
+92218 99175 76054 79907 90207 50547 31522 4244 91079 58776 83402 54109 21254 42946 83519 31242
+10925 37377 45279 19704 96633 51732 34458 9746 91761 42687 51681 54409 61058 74227 70802 34546
+64862 12022 29896 23616 50371 89808 57186 63895 94767 76388 66475 56716 50133 6604 52853 40763
+70558 74672 58190 40909 6869 49937 9271 28067 99656 25674 69442 20608 28046 73287 60416 77515
+51639 15516 40968 95524 6694 12956 83150 77099 45687 27241 6492 94966 36856 60693 720 74671
+17309 4831 69376 67757 67499 69029 5209 50738 86947 77747 10996 9167 69176 98856 29531 5865
+27654 52277 62293 30179 85049 76961 92772 65142 16252 6768 55784 20556 26088 97219 97245 44060
+64577 91018 75157 42780 96186 62948 73288 74597 2145 16047 1671 2690 2275 45398 71478 53720
+94832 91800 10398 84830 6009 9024 53132 97850 63832 13269 45376 38564 60343 85293 9330 16810
+24898 76675 32778 26905 40945 37569 43532 38650 38316 75398 60829 91004 97946 49080 93534 78275
+20002 87183 80802 56487 12666 18416 91632 74573 70729 97984 48479 93014 10281 90382 28497 15366
+29720 25646 98513 47065 37662 94058 17383 47234 87293 37849 32087 98641 62012 12584 35492 87090
+85157 90539 31005 67590 13627 44803 46789 8026 86877 18429 8935 78118 41728 67025 69312 52172
+49224 68064 93025 1195 64873 684 90039 86065 67324 66534 1110 22354 36867 27479 76286 8539
diff --git a/examples/prism-perl.html b/examples/prism-perl.html index 85c3681521..80a0874818 100644 --- a/examples/prism-perl.html +++ b/examples/prism-perl.html @@ -54,10 +54,10 @@

Full example

$conf{user} = delete $conf{username} unless $conf{user}; } else { # Process .pause manually - open my $pauserc, '<', $filename + open my $pauserc, '<', $filename or die "can't open $filename for reading: $!"; - while (<$pauserc>) { + while (<$pauserc>) { chomp; next unless $_ and $_ !~ /^\s*#/; @@ -68,4 +68,4 @@

Full example

} return \%conf; -} \ No newline at end of file +} diff --git a/examples/prism-php.html b/examples/prism-php.html index 1a25589c7c..23d4bae604 100644 --- a/examples/prism-php.html +++ b/examples/prism-php.html @@ -41,7 +41,7 @@

PHP 5.3+ support

function getReturnDescription() { /*2*/ } } function gen_one_to_three() { - for ($i = 1; $i <= 3; $i++) { + for ($i = 1; $i <= 3; $i++) { // Note that $i is preserved between yields. yield $i; } @@ -64,4 +64,4 @@

String interpolation

FOO; $b = <<<"FOOBAR" Interpolation inside Heredoc strings {$obj->values[3]->name} -FOOBAR; \ No newline at end of file +FOOBAR; diff --git a/examples/prism-powershell.html b/examples/prism-powershell.html index e5dba2e025..7028084a78 100644 --- a/examples/prism-powershell.html +++ b/examples/prism-powershell.html @@ -1,6 +1,6 @@

Comments

# This is a comment
-<# This is a
+<# This is a
 multi-line comment #>

Variable Interpolation

@@ -16,4 +16,4 @@

Full Example

$Names | ForEach { SayHello $_ } - \ No newline at end of file + diff --git a/examples/prism-prolog.html b/examples/prism-prolog.html index b231bcae7c..a0df67e5bf 100644 --- a/examples/prism-prolog.html +++ b/examples/prism-prolog.html @@ -21,24 +21,3 @@

Example

N >= 2, N1 is N - 1, N2 is N - 2, fibo(N1, F1), fibo(N2, F2), F is F1 + F2, assert(fibo(N,F):-!). % assert as first clause - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Null-ary predicates are not highlighted

-
halt.
-trace.
-
-:- if(test1).
-section_1.
-:- elif(test2).
-section_2.
-:- elif(test3).
-section_3.
-:- else.
-section_else.
-:- endif.
diff --git a/examples/prism-protobuf.html b/examples/prism-protobuf.html new file mode 100644 index 0000000000..7174552d71 --- /dev/null +++ b/examples/prism-protobuf.html @@ -0,0 +1,25 @@ +

Full example

+
syntax = "proto3";
+
+package foo.generated;
+option java_package = "org.foo.generated";
+option optimize_for = SPEED;
+
+// What's up with all the foo?
+message Foo {
+
+  message Bar {
+
+    optional string key   = 1;
+    optional Foo value = 2;
+    optional string value_raw = 3 [deprecated=true];
+  }
+
+  enum Level {
+    INFO  = 0;
+    WARN  = 1;
+    ERROR = 2;
+  }
+
+  repeated Property property = 1;
+}
diff --git a/examples/prism-pug.html b/examples/prism-pug.html index d37de5caba..ee46c8b0ec 100644 --- a/examples/prism-pug.html +++ b/examples/prism-pug.html @@ -52,7 +52,7 @@

Inline JavaScript

alert('foo'); alert('bar'); - var classes = ['foo', 'bar', 'baz'] -- for (var x = 0; x < 3; x++) +- for (var x = 0; x < 3; x++) li item diff --git a/examples/prism-puppet.html b/examples/prism-puppet.html index 4892ab8972..ff73e81fe4 100644 --- a/examples/prism-puppet.html +++ b/examples/prism-puppet.html @@ -30,7 +30,7 @@

Variables

Functions

require apache
 template('apache/vhost-default.conf.erb')
-[1,20,3].filter |$value| { $value < 10 }
+[1,20,3].filter |$value| { $value < 10 }

All-in-one example

file {'ntp.conf':
@@ -114,10 +114,10 @@ 

All-in-one example

default => 'root', } -User <| groups == 'admin' |> -Concat::Fragment <<| tag == "bacula-storage-dir-${bacula_director}" |>> +User <| groups == 'admin' |> +Concat::Fragment <<| tag == "bacula-storage-dir-${bacula_director}" |>> -Exec <| title == 'update_migrations' |> { +Exec <| title == 'update_migrations' |> { environment => 'RUBYLIB=/usr/lib/ruby/site_ruby/1.8/', } @@ -137,16 +137,3 @@

All-in-one example

target => '/etc/nagios3/conf.d/nagios_service.cfg', notify => Service[$nagios::params::nagios_service], }
- -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

More than one level of nested braces inside interpolation

-
"Foobar ${foo({
-    bar => {baz => 42}
-    baz => 42
-})} <- broken"
\ No newline at end of file diff --git a/examples/prism-pure.html b/examples/prism-pure.html index d7a0129b12..9bcac74185 100644 --- a/examples/prism-pure.html +++ b/examples/prism-pure.html @@ -24,7 +24,7 @@

Inline code

Inline code requires the desired language to be loaded. On this page, check C, C++ and Fortran before checking Pure should make the examples below work properly.

-
%<
+
%<
 int mygcd(int x, int y)
 {
   if (y == 0)
@@ -34,7 +34,7 @@ 

Inline code

} %> -%< -*- Fortran90 -*- +%< -*- Fortran90 -*- function fact(n) result(p) integer n, p p = 1 @@ -44,7 +44,7 @@

Inline code

end function fact %> -%< -*- C++ -*- +%< -*- C++ -*- #include <pure/runtime.h> #include <string> @@ -112,4 +112,4 @@

Example

safe (i,j) p = ~any (check (i,j)) p; check (i1,j1) (i2,j2) = i1==i2 || j1==j2 || i1+j1==i2+j2 || i1-j1==i2-j2; -end;
\ No newline at end of file +end;
diff --git a/examples/prism-python.html b/examples/prism-python.html index ce6efc00fb..3a63e8bc40 100644 --- a/examples/prism-python.html +++ b/examples/prism-python.html @@ -49,13 +49,3 @@

Full example

if __name__ == '__main__': import doctest doctest.testmod() - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Interpolation expressions containing strings with { or }

-
f"{'}'}"
diff --git a/examples/prism-q.html b/examples/prism-q.html index 58d674f478..9d7d5c6226 100644 --- a/examples/prism-q.html +++ b/examples/prism-q.html @@ -100,13 +100,3 @@

Example

getCAs exec distinct caType from ca adjust[t;`dividend] / adjust trades for dividends only - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

The global context is highlighted as a verb

-
\d .
\ No newline at end of file diff --git a/examples/prism-rest.html b/examples/prism-rest.html index 511e87c9e1..a7288a38b8 100644 --- a/examples/prism-rest.html +++ b/examples/prism-rest.html @@ -308,22 +308,3 @@

Inline markup

See the `Python home page <http://www.python.org>`_ for info. Oh yes, the _`Norwegian Blue`. What's, um, what's wrong with it? - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nothing is highlighted inside table cells

-
+---------------+----------+
-| column 1     | column 2  |
-+--------------+-----------+
-| **bold**?    | *italic*? |
-+--------------+-----------+
- -

The inline markup recognition rules are not as strict as they are in the spec

-

No inline markup should be highlighted in the following code.

-
2 * x a ** b (* BOM32_* ` `` _ __ |
-"*" '|' (*) [*] {*} <*> ‘*’ ‚*‘ ‘*‚ ’*’ ‚*’ “*” „*“ “*„ ”*” „*” »*« ›*‹ «*» »*» ›*›
\ No newline at end of file diff --git a/examples/prism-rust.html b/examples/prism-rust.html index d447968423..3f56a91b6f 100644 --- a/examples/prism-rust.html +++ b/examples/prism-rust.html @@ -50,19 +50,3 @@

Closure parameters and bitwise OR

let add_one = |x: int| -> int { 1i + x }; let printer = || { println!("x is: {}", x); }; - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested block comments

-
/* Nested block
-	/* comments
-	are */
-not supported */
- -

Delimiters of parameters for closures that don't use braces

-
|x| x + 1i;
\ No newline at end of file diff --git a/examples/prism-sas.html b/examples/prism-sas.html index 8932ebb036..546404bf1d 100644 --- a/examples/prism-sas.html +++ b/examples/prism-sas.html @@ -23,7 +23,7 @@

Operators

A**B;
 'foo'||'bar'!!'baz'¦¦'test';
 A<>B><C;
-A~=B¬=C^=D>=E<=F;
+A~=B¬=C^=D>=E<=F;
 a*b/c+d-e<f>g&h|i!j¦k;
 ~a;¬b;^c;
 (a eq b) ne (c gt d) lt e ge f le h;
@@ -155,4 +155,4 @@ 

More examples

JD03 switch 383 09jan2013 13.99 BV1E timer 26 03aug2013 34.50 ; -run;
\ No newline at end of file +run; diff --git a/examples/prism-sass.html b/examples/prism-sass.html index 7200e789cc..a2f0673a2b 100644 --- a/examples/prism-sass.html +++ b/examples/prism-sass.html @@ -26,22 +26,3 @@

Variables

#main width: $width - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Deprecated Sass syntax is not supported

-
.page
-  color = 5px + 9px
-
-!width = 13px
-.icon
-  width = !width
- -

Selectors with pseudo classes are highlighted as property/value pairs

-
a:hover
-  text-decoration: underline
\ No newline at end of file diff --git a/examples/prism-scala.html b/examples/prism-scala.html index 1dc56f8714..b9ed1f1b65 100644 --- a/examples/prism-scala.html +++ b/examples/prism-scala.html @@ -85,16 +85,3 @@

Full example

println("sl2 = " + sl2) } } - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested block comments

-
/* Nested block
-	/* comments
-	are */
-not supported */
\ No newline at end of file diff --git a/examples/prism-smarty.html b/examples/prism-smarty.html index 5e57922fa4..650e6fc1d4 100644 --- a/examples/prism-smarty.html +++ b/examples/prism-smarty.html @@ -69,13 +69,3 @@

Literal section

} {/literal} </style> - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Smarty tag in the middle of an HTML tag

-
<div{if $test} class="test"{/if}></div>
\ No newline at end of file diff --git a/examples/prism-swift.html b/examples/prism-swift.html index 98d6eb55e2..e49a0d4a74 100644 --- a/examples/prism-swift.html +++ b/examples/prism-swift.html @@ -29,12 +29,12 @@

Control flow

for _ in 1...power { answer *= base } -while square < finalSquare { +while square < finalSquare { // roll the dice if ++diceRoll == 7 { diceRoll = 1 } // move by the rolled amount square += diceRoll - if square < board.count { + if square < board.count { // if we're still on the board, move up or down for a snake or a ladder square += board[square] } @@ -52,29 +52,16 @@

Control flow

Classes and attributes

class MyViewController: UIViewController {
-    @IBOutlet weak var button: UIButton!
-    @IBOutlet var textFields: [UITextField]!
-    @IBAction func buttonTapped(AnyObject) {
-	    println("button tapped!")
+	@IBOutlet weak var button: UIButton!
+	@IBOutlet var textFields: [UITextField]!
+	@IBAction func buttonTapped(AnyObject) {
+		println("button tapped!")
 	}
 }
 
 @IBDesignable
 class MyCustomView: UIView {
-    @IBInspectable var textColor: UIColor
-    @IBInspectable var iconHeight: CGFloat
-    /* ... */
+	@IBInspectable var textColor: UIColor
+	@IBInspectable var iconHeight: CGFloat
+	/* ... */
 }
- -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested block comments

-
/* Nested block
-	/* comments
-	are */
-not supported */
\ No newline at end of file diff --git a/examples/prism-textile.html b/examples/prism-textile.html index 4ff4d12798..f195e9673b 100644 --- a/examples/prism-textile.html +++ b/examples/prism-textile.html @@ -156,23 +156,3 @@

Tables

|This|is|a|row| {background:#ddd}. |This|is|grey|row| - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested styles are only partially supported

- -

Only one level of nesting is supported.

- -
*A bold paragraph %containing a span with broken _italic_ inside%!*
- -

HTML inside Textile is not supported

- -

But Textile inside HTML should be just fine.

- -
<strong>This _should_ work properly.</strong>
-*But this is <em>definitely</em> broken.*
\ No newline at end of file diff --git a/examples/prism-twig.html b/examples/prism-twig.html index 0a7078151d..167ffadd95 100644 --- a/examples/prism-twig.html +++ b/examples/prism-twig.html @@ -23,13 +23,3 @@

Twig embedded in HTML

{% else %} <p>Not foo...</p> {% endif %} - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Tag containing Twig is not highlighted

-
<div{% if foo %} class="bar"{% endif %}></div>
\ No newline at end of file diff --git a/examples/prism-vbnet.html b/examples/prism-vbnet.html index bc2a376b2e..b5e3081284 100644 --- a/examples/prism-vbnet.html +++ b/examples/prism-vbnet.html @@ -7,10 +7,10 @@

Example

Public Function findValue(ByVal arr() As Double,
     ByVal searchValue As Double) As Double
     Dim i As Integer = 0
-    While i <= UBound(arr) AndAlso arr(i) <> searchValue
+    While i <= UBound(arr) AndAlso arr(i) <> searchValue
         ' If i is greater than UBound(arr), searchValue is not checked.
         i += 1
     End While
     If i > UBound(arr) Then i = -1
     Return i
-End Function
\ No newline at end of file +End Function diff --git a/examples/prism-vhdl.html b/examples/prism-vhdl.html index b495085155..0d3b56f6b9 100644 --- a/examples/prism-vhdl.html +++ b/examples/prism-vhdl.html @@ -5,8 +5,8 @@

Comments

Literals

constant FREEZE : integer := 32;
 constant TEMP : real := 32.0;
-A_INT <= 16#FF#;
-B_INT <= 2#1010_1010#;
+A_INT <= 16#FF#;
+B_INT <= 2#1010_1010#;
 MONEY := 1_000_000.0;
 FACTOR := 2.2E-6;
 constant DEL1 :time := 10 ns;
@@ -17,9 +17,9 @@ 

Literals

signal STATE : T_STATE := IDLE; constant FLAG :bit_vector(0 to 7) := "11111111"; constant MSG : string := "Hello"; -BIT_8_BUS <= B"1111_1111"; -BIT_9_BUS <= O"353"; -BIT_16_BUS <= X"AA55"; +BIT_8_BUS <= B"1111_1111"; +BIT_9_BUS <= O"353"; +BIT_16_BUS <= X"AA55"; constant TWO_LINE_MSG : string := "Hello" & CR & "World";

Full example

@@ -37,8 +37,8 @@

Full example

architecture circuits of fadd is -- full adder stage, body begin -- circuits of fadd - s <= a xor b xor cin after 1 ns; - cout <= (a and b) or (a and cin) or (b and cin) after 1 ns; + s <= a xor b xor cin after 1 ns; + cout <= (a and b) or (a and cin) or (b and cin) after 1 ns; end architecture circuits; -- of fadd library IEEE; diff --git a/examples/prism-wiki.html b/examples/prism-wiki.html index 295eb3f812..99dbd0c618 100644 --- a/examples/prism-wiki.html +++ b/examples/prism-wiki.html @@ -143,23 +143,3 @@

Tables

| |15.00 |} - -

Known failures

-

There are certain edge cases where Prism will fail. - There are always such cases in every regex-based syntax highlighter. - However, Prism dares to be open and honest about them. - If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug. -

- -

Nested magic words are not supported

- -
{{#switch:{{PAGENAME}}
-| L'Aquila = No translation
-| L = Not OK
-| L'Aquila = Entity escaping
-| L'Aquila = Numeric char encoding
-}}
- -

Nesting of bold and italic is not supported

-
''Italic with '''bold''' inside''
- diff --git a/examples/prism-xojo.html b/examples/prism-xojo.html index 35480744dd..5dd8fc85e5 100644 --- a/examples/prism-xojo.html +++ b/examples/prism-xojo.html @@ -21,8 +21,8 @@

Example

Dim g As Graphics
 Dim yOffSet As Integer
 g = OpenPrinterDialog()
-If g <> Nil Then
-  If MainDishMenu.ListIndex <> -1 Then
+If g <> Nil Then
+  If MainDishMenu.ListIndex <> -1 Then
     g.Bold = True
     g.DrawString("Main Dish:",20,20)
     g.Bold = False
diff --git a/examples/prism-yaml.html b/examples/prism-yaml.html
index bea52f8651..58b78f60cc 100644
--- a/examples/prism-yaml.html
+++ b/examples/prism-yaml.html
@@ -89,7 +89,7 @@ 

Full example

state : MI postal : 48046 ship-to: - <<: *id001 + <<: *id001 product: - sku : BL394D quantity : 4 diff --git a/extending.html b/extending.html index 1051a31ffb..dfc3f1a329 100644 --- a/extending.html +++ b/extending.html @@ -133,16 +133,22 @@

Parameters

Creating a new language definition

+

This section will explain the usual workflow of creating a new language definition.

+ +

As an example, we will create the language definition of the fictional Foo's Binary, Artistic Robots™ language or just Foo Bar for short.

+
  1. -

    Create a new file components/prism-lang-id.js.

    +

    Create a new file components/prism-foo-bar.js.

    + +

    In this example, we choose foo-bar as the id of the new language. The language id has to be unique and should work well with the language-xxxx CSS class name Prism uses to refer to language definitions. Your language id should ideally match the regular expression /^[a-z][a-z\d]*(?:-[a-z][a-z\d]*)*$/.

  2. Edit components.json to register the new language by adding it to the languages object. (Please note that all language entries are sorted alphabetically by title.)
    - Your new entry will look like this:

    + Our new entry for this example will look like this:

    -
    "lang-id": {
    -	"title": "Language Title",
    +			
    "foo-bar": {
    +	"title": "Foo Bar",
     	"owner": "Your GitHub name"
     }
    @@ -153,22 +159,58 @@

    Creating a new language definition

  3. Rebuild Prism by running npx gulp.

    -

    This will make your language available to the test page, or more precise: your local version of it. You can open you local test.html page in any browser, select your language, and see how your language definition highlights the given code.

    +

    This will make your language available to the test page, or more precise: your local version of it. You can open your local test.html page in any browser, select your language, and see how your language definition highlights any code you input.

    -

    Note: You have to reload the page to apply changes made to prism-lang-id.js.

    +

    Note: You have to reload the test page to apply changes made to prism-foo-bar.js.

  4. Write the language definition.

    The above section already explains the makeup of language definitions.

  5. +
  6. +

    Adding aliases.

    + +

    Aliases for are useful if your language is known under more than just one name or there are very common abbreviations for your language (e.g. JS for JavaScript). Keep in mind that aliases are very similar to language ids in that they also have to be unique (i.e. there cannot be an alias which is the same as another alias of language id) and work as CSS class names.

    + +

    In this example, we will register the alias foo for foo-bar because Foo Bar code is stored in .foo files.

    + +

    To add the alias, we add this line at the end of prism-foo-bar.js:

    + +
    Prism.languages.foo = Prism.language['foo-bar'];
    + +

    Aliases also have to be registered in components.json by adding the alias property to the language entry. In this example, the updated entry will look like this:

    + +
    "foo-bar": {
    +	"title": "Foo Bar",
    +	"alias": "foo",
    +	"owner": "Your GitHub name"
    +}
    + +

    Note: alias can also be a string array if you need to register multiple aliases.

    + +

    Using aliasTitles, it's also possible to give aliases specific titles. In this example, this won't be necessary but a good example as to where this is useful is the markup language:

    + +
    "markup": {
    +	"title": "Markup",
    +	"alias": ["html", "xml", "svg", "mathml"],
    +	"aliasTitles": {
    +		"html": "HTML",
    +		"xml": "XML",
    +		"svg": "SVG",
    +		"mathml": "MathML"
    +	},
    +	"option": "default"
    +}
    +
  7. Add some tests.

    -

    Create a folder tests/languages/lang-id/. This is where your test files will live. The test format and how to run tests is described here. A good example are the tests of the JavaScript language.

    +

    Create a folder tests/languages/foo-bar/. This is where your test files will live. The test format and how to run tests is described here.

    + +

    You should add a test for every major feature of your language. Test files should test the common case and certain edge cases (if any). Good examples are the tests of the JavaScript language.

    -

    You should add a test for every major feature of your language. Test files should test the common case and certain edge cases (if any).
    - You can use this template for new .test files:

    +

    You can use this template for new .test files:

    The code to test.
     
    @@ -192,13 +234,13 @@ 

    Creating a new language definition

  8. Once you carefully checked that the test case is handled correctly (i.e. by using the test page), run the following command:

    - npm run test:languages -- --language=lang-id --pretty + npm run test:languages -- --language=foo-bar --pretty

    This command will check only your test files. The new test will fail because the specified JSON is incorrect but the error message of the failed test will also include the JSON of the simplified token stream Prism created. This is what we're after. Replace the current incorrect JSON with the output labeled Token Stream. (Please also adjust the indentation. We use tabs.)

  9. Carefully check that the token stream JSON you just inserted is what you expect.

  10. -
  11. Re-run npm run test:languages -- --language=lang-id --pretty to verify that the test passes.
  12. +
  13. Re-run npm run test:languages -- --language=foo-bar --pretty to verify that the test passes.
  • @@ -208,7 +250,7 @@

    Creating a new language definition

  • Add an example page.

    -

    Create a new file examples/prism-lang-id.html. This will be the template containing the example markup. Just look at other examples to see how these files are structured.
    +

    Create a new file examples/prism-foo-bar.html. This will be the template containing the example markup. Just look at other examples to see how these files are structured.
    We don't have any rules as to what counts as an example, so a single Full example section where you present the highlighting of the major features of the language is enough.

  • diff --git a/index.html b/index.html index ae717859ee..0bb0d68d9b 100644 --- a/index.html +++ b/index.html @@ -115,7 +115,7 @@

    Full list of features

    Limitations

    • Any pre-existing HTML in the code will be stripped off. There are ways around it though.
    • -
    • Regex-based so it *will* fail on certain edge cases, which are documented in the Examples section.
    • +
    • Regex-based so it *will* fail on certain edge cases, which are documented in the known failues page.
    • No IE 6-8 support. If someone can read code, they are probably in the 85% of the population with a modern browser.
  • @@ -152,6 +152,27 @@

    Basic usage

    If you want to prevent any elements from being automatically highlighted, you can use the attribute data-manual on the <script> element you used for prism and use the API. Example:

    <script src="prism.js" data-manual></script>
    +

    Usage with CDNs

    + +

    In combination with CDNs, we recommend using the Autoloader plugin which automatically loads languages when necessary.

    + +

    The setup of the Autoloader, will look like the following. You can also your own themes of course.

    + +
    <!DOCTYPE html>
    +<html>
    +<head>
    +	...
    +	<link href="https://myCDN.com/prism@v1.x/themes/prism.css" rel="stylesheet" />
    +</head>
    +<body>
    +	...
    +	<script src="https://myCDN.com/prism@v1.x/components/prism-core.min.js"></script>
    +	<script src="https://myCDN.com/prism@v1.x/plugins/autoloader/prism-autoloader.min.js"></script>
    +	<script>Prism.plugins.autoloader.languages_path = 'https://myCDN.com/prism@v1.x/components/'</script>
    +</body>
    +</html>
    + +

    CDNs which provide PrismJS are e.g. cdnjs and jsDelivr.

    Usage with Webpack, Browserify, & Other Bundlers

    diff --git a/known-failures.html b/known-failures.html new file mode 100644 index 0000000000..ebd401e27d --- /dev/null +++ b/known-failures.html @@ -0,0 +1,384 @@ + + + + + + +Known failures ▲ Prism + + + + + + + + + + +
    +
    + +

    Known failures

    +

    A list of rare edge cases where Prism highlights code incorrectly.

    +
    + +
    +

    There are certain edge cases where Prism will fail. There are always such cases in every regex-based syntax highlighter.
    + However, Prism dares to be open and honest about them. If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.

    +
    + + +
    + +

    Comments only support one level of nesting

    +
    (* Nested block
    +	(* comments
    +		(* on more than
    +		2 levels *)
    +	are *)
    +not supported *)
    + +
    + + +
    + +

    Nested block comments

    +
    #cs
    +	#cs
    +		foo()
    +	#ce
    +#ce
    + +
    + + +
    + +

    Two levels of nesting inside C section

    +
    {
    +	if($1) {
    +		if($2) {
    +
    +		}
    +	}
    +} // <- Broken
    +%%
    +%%
    + +
    + + +
    + +

    Comments only support one level of nesting

    +
    /+ /+ /+ this does not work +/ +/ +/
    + +

    Token strings only support one level of nesting

    +
    q{ q{ q{ this does not work } } }
    + +
    + + +
    + +

    String interpolation in single-quoted strings

    +
    '#{:atom} <- this should not be highligted'
    + +
    + + +
    + +

    Two divisions on the same line

    +
    2 / 3 / 4
    + +
    + + +
    + +

    Names starting with a number

    +
    The box 1A is a container
    + +
    + + +
    + +

    String interpolation containing a closing brace

    +
    `${ /* } */ a + b }`
    +`${ '}' }`
    + +

    String interpolation with deeply nested braces

    +
    `${foo({ a: { b: { c: true } } })}`
    + +
    + + +
    + +

    At-rules looking like variables

    +
    @import "some file.less";
    + +

    At-rules containing interpolation

    +
    @import "@{themes}/tidal-wave.less";
    + +

    extend is not highlighted consistently

    +
    nav ul {
    +  &:extend(.inline);
    +  background: blue;
    +}
    +.a:extend(.b) {}
    + +
    + + +
    + +

    Functions with a single string parameter not using parentheses are not highlighted

    +
    foobar"param";
    + +
    + + +
    + +

    Nesting of elements is not fully supported

    +
    [Link partially *italic* DOESN'T work](http://example.com)
    +_ [But link inside italic DOES work](http://example.com) _
    +
    +[Link partially **bold** DOESN'T work](http://example.com)
    +__ [But link inside bold DOES work](http://example.com) __
    + +
    + + +
    + +

    Numbers with underscores

    +
    mov     ax,1100_1000b
    +mov     ax,1100_1000y
    +mov     ax,0b1100_1000
    +mov     ax,0y1100_1000
    +
    +dd    1.222_222_222
    + +
    + + +
    + +

    Code block starting with a comment

    +
    # Doesn't work
    +# Does work
    +
     # Does work when prefixed with a space
    + +

    Comments inside expressions break literals and operators

    +
    ^if(
    +    $age>=4  # not too young
    +    && $age<=80  # and not too old
    +)
    + +
    + + +
    + +

    Null-ary predicates are not highlighted

    +
    halt.
    +trace.
    +
    +:- if(test1).
    +section_1.
    +:- elif(test2).
    +section_2.
    +:- elif(test3).
    +section_3.
    +:- else.
    +section_else.
    +:- endif.
    + +
    + + +
    + +

    More than one level of nested braces inside interpolation

    +
    "Foobar ${foo({
    +    bar => {baz => 42}
    +    baz => 42
    +})} <- broken"
    + +
    + + +
    + +

    Interpolation expressions containing strings with { or }

    +
    f"{'}'}"
    + +
    + + +
    + +

    The global context is highlighted as a verb

    +
    \d .
    + +
    + + +
    + +

    Nothing is highlighted inside table cells

    +
    +---------------+----------+
    +| column 1     | column 2  |
    ++--------------+-----------+
    +| **bold**?    | *italic*? |
    ++--------------+-----------+
    + +

    The inline markup recognition rules are not as strict as they are in the spec

    +

    No inline markup should be highlighted in the following code.

    +
    2 * x a ** b (* BOM32_* ` `` _ __ |
    +"*" '|' (*) [*] {*} <*> ‘*’ ‚*‘ ‘*‚ ’*’ ‚*’ “*” „*“ “*„ ”*” „*” »*« ›*‹ «*» »*» ›*›
    + +
    + + +
    + +

    Nested block comments

    +
    /* Nested block
    +	/* comments
    +	are */
    +not supported */
    + +

    Delimiters of parameters for closures that don't use braces

    +
    |x| x + 1i;
    + +
    + + +
    + +

    Deprecated Sass syntax is not supported

    +
    .page
    +  color = 5px + 9px
    +
    +!width = 13px
    +.icon
    +  width = !width
    + +

    Selectors with pseudo classes are highlighted as property/value pairs

    +
    a:hover
    +  text-decoration: underline
    + +
    + + +
    + +

    Nested block comments

    +
    /* Nested block
    +	/* comments
    +	are */
    +not supported */
    + +
    + + +
    + +

    Nested block comments

    +
    /* Nested block
    +	/* comments
    +	are */
    +not supported */
    + +
    + + +
    + +

    HTML inside Textile is not supported

    + +

    But Textile inside HTML should be just fine.

    + +
    <strong>This _should_ work properly.</strong>
    +*But this is <em>definitely</em> broken.*
    + +
    + + +
    + +

    Tag containing Twig is not highlighted

    +
    <div{% if foo %} class="bar"{% endif %}></div>
    + +
    + + +
    + +

    Nested magic words are not supported

    + +
    {{#switch:{{PAGENAME}}
    +| L'Aquila = No translation
    +| L = Not OK
    +| L'Aquila = Entity escaping
    +| L'Aquila = Numeric char encoding
    +}}
    + +

    Nesting of bold and italic is not supported

    +
    ''Italic with '''bold''' inside''
    + +
    + + +
    + + + + + + + + + + diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js index c1415b08c0..185e2406f5 100644 --- a/plugins/autoloader/prism-autoloader.js +++ b/plugins/autoloader/prism-autoloader.js @@ -144,6 +144,7 @@ "md": "markdown", "n4jsd": "n4js", "objectpascal": "pascal", + "px": "pcaxis", "py": "python", "rb": "ruby", "ts": "typescript", @@ -153,6 +154,13 @@ "yml": "yaml" }/*]*/; + /** + * @typedef LangDataItem + * @property {{ success?: function, error?: function }[]} callbacks + * @property {boolean} [error] + * @property {boolean} [loading] + */ + /** @type {Object} */ var lang_data = {}; var ignored_language = 'none'; @@ -216,11 +224,6 @@ lang = lang_aliases[lang]; } - var data = lang_data[lang]; - if (!data) { - data = lang_data[lang] = {}; - } - // Look for additional dependencies defined on the or
     tags
     		var deps = elt.getAttribute('data-dependencies');
     		if (!deps && elt.parentNode && elt.parentNode.tagName.toLowerCase() === 'pre') {
    @@ -282,20 +285,14 @@
     		var load = function () {
     			var data = lang_data[lang];
     			if (!data) {
    -				data = lang_data[lang] = {};
    -			}
    -			if (success) {
    -				if (!data.success_callbacks) {
    -					data.success_callbacks = [];
    -				}
    -				data.success_callbacks.push(success);
    -			}
    -			if (error) {
    -				if (!data.error_callbacks) {
    -					data.error_callbacks = [];
    -				}
    -				data.error_callbacks.push(error);
    +				data = lang_data[lang] = {
    +					callbacks: []
    +				};
     			}
    +			data.callbacks.push({
    +				success: success,
    +				error: error
    +			});
     
     			if (!force && Prism.languages[lang]) {
     				languageSuccess(lang);
    @@ -329,10 +326,14 @@
     	 * @param {string} lang
     	 */
     	var languageSuccess = function (lang) {
    -		if (lang_data[lang] && lang_data[lang].success_callbacks && lang_data[lang].success_callbacks.length) {
    -			lang_data[lang].success_callbacks.forEach(function (f) {
    -				f(lang);
    -			});
    +		if (lang_data[lang] ) {
    +			var callbacks = lang_data[lang].callbacks;
    +			while (callbacks.length) {
    +				var callback = callbacks.shift().success;
    +				if (callback) {
    +					callback();
    +				}
    +			}
     		}
     	};
     
    @@ -341,10 +342,14 @@
     	 * @param {string} lang
     	 */
     	var languageError = function (lang) {
    -		if (lang_data[lang] && lang_data[lang].error_callbacks && lang_data[lang].error_callbacks.length) {
    -			lang_data[lang].error_callbacks.forEach(function (f) {
    -				f(lang);
    -			});
    +		if (lang_data[lang]) {
    +			var callbacks = lang_data[lang].callbacks;
    +			while (callbacks.length) {
    +				var callback = callbacks.shift().error;
    +				if (callback) {
    +					callback();
    +				}
    +			}
     		}
     	};
     
    diff --git a/plugins/autoloader/prism-autoloader.min.js b/plugins/autoloader/prism-autoloader.min.js
    index 319b6f3459..4aac440bf7 100644
    --- a/plugins/autoloader/prism-autoloader.min.js
    +++ b/plugins/autoloader/prism-autoloader.min.js
    @@ -1 +1 @@
    -!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&document.createElement){var i={javascript:"clike",actionscript:"javascript",arduino:"cpp",aspnet:["markup","csharp"],bison:"c",c:"clike",csharp:"clike",cpp:"c",coffeescript:"javascript",crystal:"ruby","css-extras":"css",d:"clike",dart:"clike",django:"markup-templating",ejs:["javascript","markup-templating"],erb:["ruby","markup-templating"],fsharp:"clike",flow:"javascript",glsl:"clike",gml:"clike",go:"clike",groovy:"clike",haml:"ruby",handlebars:"markup-templating",haxe:"clike",java:"clike",javadoc:["markup","java","javadoclike"],jolie:"clike",jsdoc:["javascript","javadoclike"],"js-extras":"javascript",jsonp:"json",json5:"json",kotlin:"clike",less:"css",markdown:"markup","markup-templating":"markup",n4js:"javascript",nginx:"clike",objectivec:"c",opencl:"cpp",parser:"markup",php:["clike","markup-templating"],phpdoc:["php","javadoclike"],"php-extras":"php",plsql:"sql",processing:"clike",protobuf:"clike",pug:["markup","javascript"],qore:"clike",jsx:["markup","javascript"],tsx:["jsx","typescript"],reason:"clike",ruby:"clike",sass:"css",scss:"css",scala:"java","shell-session":"bash",smarty:"markup-templating",soy:"markup-templating",swift:"clike",tap:"yaml",textile:"markup",tt2:["clike","markup-templating"],twig:"markup",typescript:"javascript","t4-cs":["t4-templating","csharp"],"t4-vb":["t4-templating","visual-basic"],vala:"clike",vbnet:"basic",velocity:"markup",wiki:"markup",xeora:"markup",xquery:"markup"},l={html:"markup",xml:"markup",svg:"markup",mathml:"markup",js:"javascript",adoc:"asciidoc",shell:"bash",rbnf:"bnf",cs:"csharp",dotnet:"csharp",coffee:"coffeescript",jinja2:"django",dockerfile:"docker",gamemakerlanguage:"gml",hs:"haskell",tex:"latex",context:"latex",emacs:"lisp",elisp:"lisp","emacs-lisp":"lisp",md:"markdown",n4jsd:"n4js",objectpascal:"pascal",py:"python",rb:"ruby",ts:"typescript",t4:"t4-cs",vb:"visual-basic",xeoracube:"xeora",yml:"yaml"},n={},a=document.getElementsByTagName("script"),e="components/";if((a=a[a.length-1]).hasAttribute("data-autoloader-path")){var c=a.getAttribute("data-autoloader-path").trim();0} the list of dependencies. Empty if the language has none.
    + * @returns {Array} the list of dependencies. Empty if the language has none.
      */
    -function getDependenciesOfLanguage (lang)
    -{
    -	if (!components.languages[lang] || !components.languages[lang].require)
    -	{
    +function getDependenciesOfLanguage(lang) {
    +	if (!components.languages[lang] || !components.languages[lang].require) {
     		return [];
     	}
     
    diff --git a/style.css b/style.css
    index 64f79af69e..221b6cd728 100644
    --- a/style.css
    +++ b/style.css
    @@ -24,7 +24,6 @@ footer p {
     * {
     	margin: 0;
     	padding: 0;
    -	font-weight: normal;
     }
     
     body {
    @@ -77,6 +76,10 @@ h2 {
     	margin: 1em 0 .3em;
     }
     
    +h2 {
    +	font-weight: normal;
    +}
    +
     dt {
     	margin: 1em 0 0 0;
     	font-size: 130%;
    diff --git a/tests/languages/markdown/bold_feature.test b/tests/languages/markdown/bold_feature.test
    index 486e6ab60e..db915b9131 100644
    --- a/tests/languages/markdown/bold_feature.test
    +++ b/tests/languages/markdown/bold_feature.test
    @@ -8,72 +8,185 @@ bar__
     __foo*bar*baz__
     __foo_bar_baz__
     __foo~bar~baz__
    +__foo~~bar~~baz__
     __foo[bar](baz)__
     
    +**foo*bar*baz**
    +**foo_bar_baz**
    +**foo~bar~baz**
    +**foo~~bar~~baz**
    +**foo[bar](baz)**
    +
     ----------------------------------------------------
     
     [
     	["bold", [
     		["punctuation", "**"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "**"]
     	]],
     	["bold", [
     		["punctuation", "**"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
     		["punctuation", "**"]
     	]],
     	["bold", [
     		["punctuation", "__"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "__"]
     	]],
     	["bold", [
     		["punctuation", "__"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
    +		["punctuation", "__"]
    +	]],
    +	["bold", [
    +		["punctuation", "__"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			"baz"
    +		]],
     		["punctuation", "__"]
     	]],
    -
     	["bold", [
     		["punctuation", "__"],
    -		"foo",
    -		["italic", [
    -			["punctuation", "*"],
    -			"bar",
    -			["punctuation", "*"]
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "_"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "_"]
    +			]],
    +			"baz"
     		]],
    -		"baz",
     		["punctuation", "__"]
     	]],
     	["bold", [
     		["punctuation", "__"],
    -		"foo",
    -		["italic", [
    -			["punctuation", "_"],
    -			"bar",
    -			["punctuation", "_"]
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~"]
    +			]],
    +			"baz"
     		]],
    -		"baz",
     		["punctuation", "__"]
     	]],
     	["bold", [
     		["punctuation", "__"],
    -		"foo",
    -		["strike", [
    -			["punctuation", "~"],
    -			"bar",
    -			["punctuation", "~"]
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~~"]
    +			]],
    +			"baz"
     		]],
    -		"baz",
     		["punctuation", "__"]
     	]],
     	["bold", [
     		["punctuation", "__"],
    -		"foo",
    -		["url", [
    -			"[bar](baz)"
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
     		]],
     		["punctuation", "__"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "_"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "_"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~~"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
    +		]],
    +		["punctuation", "**"]
     	]]
     ]
     
    diff --git a/tests/languages/markdown/italic_feature.test b/tests/languages/markdown/italic_feature.test
    index 02ced18027..fc9c6c858e 100644
    --- a/tests/languages/markdown/italic_feature.test
    +++ b/tests/languages/markdown/italic_feature.test
    @@ -5,42 +5,191 @@ _foobar_
     _foo
     bar_
     
    +_foo__bar__baz_
    +_foo**bar**baz_
    +_foo~bar~baz_
    +_foo~~bar~~baz_
     _foo[bar](baz)_
     
    +*foo__bar__baz*
    +*foo**bar**baz*
    +*foo~bar~baz*
    +*foo~~bar~~baz*
    +*foo[bar](baz)*
    +
     ----------------------------------------------------
     
     [
     	["italic", [
     		["punctuation", "*"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "*"]
     	]],
     	["italic", [
     		["punctuation", "*"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
     		["punctuation", "*"]
     	]],
     	["italic", [
     		["punctuation", "_"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "_"]
     	]],
     	["italic", [
     		["punctuation", "_"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
    +		["punctuation", "_"]
    +	]],
    +	["italic", [
    +		["punctuation", "_"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "__"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "__"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "_"]
    +	]],
    +	["italic", [
    +		["punctuation", "_"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "_"]
    +	]],
    +	["italic", [
    +		["punctuation", "_"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "_"]
    +	]],
    +	["italic", [
    +		["punctuation", "_"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~~"]
    +			]],
    +			"baz"
    +		]],
     		["punctuation", "_"]
     	]],
    -
     	["italic", [
     		["punctuation", "_"],
    -		"foo",
    -		["url", [
    -			"[bar](baz)"
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
     		]],
     		["punctuation", "_"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "__"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "__"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"foo",
    +			["strike", [
    +				["punctuation", "~~"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "~~"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
    +		]],
    +		["punctuation", "*"]
     	]]
     ]
     
     ----------------------------------------------------
     
    -Checks for italic. Also tests for inclusion of url.
    \ No newline at end of file
    +Checks for italic. Also tests for inclusion of url.
    diff --git a/tests/languages/markdown/nested_bold_italic_feature.test b/tests/languages/markdown/nested_bold_italic_feature.test
    new file mode 100644
    index 0000000000..63eefe4f33
    --- /dev/null
    +++ b/tests/languages/markdown/nested_bold_italic_feature.test
    @@ -0,0 +1,162 @@
    +**a *b* c**
    +
    +*a **b** c*
    +
    +***abc***
    +
    +*b **c***
    +
    +**b *c***
    +
    +***b *c**
    +
    +***c **c*
    +
    +*a \* b*
    +
    +*a **b***
    +
    +**a *b***
    +
    +----------------------------------------------------
    +
    +[
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"a ",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"b"
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			" c"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"a ",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"b"
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			" c"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"abc"
    +				]],
    +				["punctuation", "*"]
    +			]]
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"b ",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"c"
    +				]],
    +				["punctuation", "**"]
    +			]]
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"b ",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"c"
    +				]],
    +				["punctuation", "*"]
    +			]]
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"b "
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			"c"
    +		]],
    +		["punctuation", "**"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"c "
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			"c"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"a \\* b"
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["italic", [
    +		["punctuation", "*"],
    +		["content", [
    +			"a ",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"b"
    +				]],
    +				["punctuation", "**"]
    +			]]
    +		]],
    +		["punctuation", "*"]
    +	]],
    +	["bold", [
    +		["punctuation", "**"],
    +		["content", [
    +			"a ",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"b"
    +				]],
    +				["punctuation", "*"]
    +			]]
    +		]],
    +		["punctuation", "**"]
    +	]]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for nested versions of bold and italic.
    diff --git a/tests/languages/markdown/strike_feature.test b/tests/languages/markdown/strike_feature.test
    index 49a4a139a4..414fb8bdc0 100644
    --- a/tests/languages/markdown/strike_feature.test
    +++ b/tests/languages/markdown/strike_feature.test
    @@ -6,62 +6,187 @@ bar~~
     bar~
     
     ~foo*bar*baz~
    +~foo_bar_baz~
    +~foo**bar**baz~
     ~foo__bar__baz~
     ~foo[bar](baz)~
     
    +~~foo*bar*baz~~
    +~~foo_bar_baz~~
    +~~foo**bar**baz~~
    +~~foo__bar__baz~~
    +~~foo[bar](baz)~~
    +
     ----------------------------------------------------
     
     [
     	["strike", [
     		["punctuation", "~~"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "~~"]
     	]],
     	["strike", [
     		["punctuation", "~~"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
     		["punctuation", "~~"]
     	]],
     	["strike", [
     		["punctuation", "~"],
    -		"foobar",
    +		["content", [
    +			"foobar"
    +		]],
     		["punctuation", "~"]
     	]],
     	["strike", [
     		["punctuation", "~"],
    -		"foo\r\nbar",
    +		["content", [
    +			"foo\r\nbar"
    +		]],
    +		["punctuation", "~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			"baz"
    +		]],
     		["punctuation", "~"]
     	]],
    -
     	["strike", [
     		["punctuation", "~"],
    -		"foo",
    -		["italic", [
    -			["punctuation", "*"],
    -			"bar",
    -			["punctuation", "*"]
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "_"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "_"]
    +			]],
    +			"baz"
     		]],
    -		"baz",
     		["punctuation", "~"]
     	]],
     	["strike", [
     		["punctuation", "~"],
    -		"foo",
    -		["bold", [
    -			["punctuation", "__"],
    -			"bar",
    -			["punctuation", "__"]
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			"baz"
     		]],
    -		"baz",
     		["punctuation", "~"]
     	]],
     	["strike", [
     		["punctuation", "~"],
    -		"foo",
    -		["url", [
    -			"[bar](baz)"
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "__"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "__"]
    +			]],
    +			"baz"
     		]],
     		["punctuation", "~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~"],
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
    +		]],
    +		["punctuation", "~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~~"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "*"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "*"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "~~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~~"],
    +		["content", [
    +			"foo",
    +			["italic", [
    +				["punctuation", "_"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "_"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "~~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~~"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "**"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "**"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "~~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~~"],
    +		["content", [
    +			"foo",
    +			["bold", [
    +				["punctuation", "__"],
    +				["content", [
    +					"bar"
    +				]],
    +				["punctuation", "__"]
    +			]],
    +			"baz"
    +		]],
    +		["punctuation", "~~"]
    +	]],
    +	["strike", [
    +		["punctuation", "~~"],
    +		["content", [
    +			"foo",
    +			["url", [
    +				"[bar](baz)"
    +			]]
    +		]],
    +		["punctuation", "~~"]
     	]]
     ]
     
    diff --git a/tests/languages/pcaxis/boolean_feature.test b/tests/languages/pcaxis/boolean_feature.test
    new file mode 100644
    index 0000000000..2c77d3f9ee
    --- /dev/null
    +++ b/tests/languages/pcaxis/boolean_feature.test
    @@ -0,0 +1,13 @@
    +YES
    +NO
    +
    +----------------------------------------------------
    +
    +[
    +	["boolean", "YES"],
    +	["boolean", "NO"]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for booleans.
    diff --git a/tests/languages/pcaxis/keyword_feature.test b/tests/languages/pcaxis/keyword_feature.test
    new file mode 100644
    index 0000000000..c5c6bf8f4c
    --- /dev/null
    +++ b/tests/languages/pcaxis/keyword_feature.test
    @@ -0,0 +1,76 @@
    +FOO=0;
    +FOO[en]=1;
    +FOO("param")=0;
    +FOO("param1","param2")=0;
    +FOO-BAR[en]("param1","param2")=1;
    +
    +----------------------------------------------------
    +
    +[
    +	["keyword", [
    +		["keyword", "FOO"]
    +	]],
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +	["keyword", [
    +		["keyword", "FOO"],
    +		["language", [
    +			["punctuation", "["],
    +			["property", "en"],
    +			["punctuation", "]"]
    +		]]
    +	]],
    +	["operator", "="],
    +	["number", "1"],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO"],
    +		["sub-key", [
    +			["punctuation", "("],
    +			["parameter", "\"param\""],
    +			["punctuation", ")"]
    +		]]
    +	]],
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO"],
    +		["sub-key", [
    +			["punctuation", "("],
    +			["parameter", "\"param1\""],
    +			["punctuation", ","],
    +			["parameter", "\"param2\""],
    +			["punctuation", ")"]
    +		]]
    +	]],
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO-BAR"],
    +		["language", [
    +			["punctuation", "["],
    +			["property", "en"],
    +			["punctuation", "]"]
    +		]],
    +		["sub-key", [
    +			["punctuation", "("],
    +			["parameter", "\"param1\""],
    +			["punctuation", ","],
    +			["parameter", "\"param2\""],
    +			["punctuation", ")"]
    +		]]
    +	]],
    +	["operator", "="],
    +	["number", "1"],
    +	["punctuation", ";"]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for keywords.
    diff --git a/tests/languages/pcaxis/number_feature.test b/tests/languages/pcaxis/number_feature.test
    new file mode 100644
    index 0000000000..898b383de4
    --- /dev/null
    +++ b/tests/languages/pcaxis/number_feature.test
    @@ -0,0 +1,17 @@
    +0
    +123456789
    +123.456
    +0.123
    +
    +----------------------------------------------------
    +
    +[
    +	["number", "0"],
    +	["number", "123456789"],
    +	["number", "123.456"],
    +	["number", "0.123"]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for numbers.
    diff --git a/tests/languages/pcaxis/string_feature.test b/tests/languages/pcaxis/string_feature.test
    new file mode 100644
    index 0000000000..f432e689d3
    --- /dev/null
    +++ b/tests/languages/pcaxis/string_feature.test
    @@ -0,0 +1,13 @@
    +"foo ,; ()[] bar"
    +""
    +
    +----------------------------------------------------
    +
    +[
    +	["string", "\"foo ,; ()[] bar\""],
    +	["string", "\"\""]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for strings.
    diff --git a/tests/languages/pcaxis/tlist_feature.test b/tests/languages/pcaxis/tlist_feature.test
    new file mode 100644
    index 0000000000..828a803e63
    --- /dev/null
    +++ b/tests/languages/pcaxis/tlist_feature.test
    @@ -0,0 +1,72 @@
    +FOO=TLIST(A1),"bar","baz";
    +FOO=TLIST(A1);
    +FOO=TLIST(A1,"bar","baz");
    +FOO=TLIST(A1,"1"-"100");
    +
    +----------------------------------------------------
    +
    +[
    +	["keyword", [
    +		["keyword", "FOO"]
    +	]],
    +	["operator", "="],
    +	["tlist", [
    +		["function", "TLIST"],
    +		["punctuation", "("],
    +		["property", "A1"],
    +		["punctuation", ")"]
    +	]],
    +	["punctuation", ","],
    +	["string", "\"bar\""],
    +	["punctuation", ","],
    +	["string", "\"baz\""],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO"]
    +	]],
    +	["operator", "="],
    +	["tlist", [
    +		["function", "TLIST"],
    +		["punctuation", "("],
    +		["property", "A1"],
    +		["punctuation", ")"]
    +	]],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO"]
    +	]],
    +	["operator", "="],
    +	["tlist", [
    +		["function", "TLIST"],
    +		["punctuation", "("],
    +		["property", "A1"],
    +		["punctuation", ","],
    +		["string", "\"bar\""],
    +		["punctuation", ","],
    +		["string", "\"baz\""],
    +		["punctuation", ")"]
    +	]],
    +	["punctuation", ";"],
    +
    +	["keyword", [
    +		["keyword", "FOO"]
    +	]],
    +	["operator", "="],
    +	["tlist", [
    +		["function", "TLIST"],
    +		["punctuation", "("],
    +		["property", "A1"],
    +		["punctuation", ","],
    +		["string", "\"1\""],
    +		["operator", "-"],
    +		["string", "\"100\""],
    +		["punctuation", ")"]
    +	]],
    +	["punctuation", ";"]
    +]
    +
    +----------------------------------------------------
    +
    +Checks for TLIST.
    diff --git a/tests/languages/protobuf/annotation_feature.test b/tests/languages/protobuf/annotation_feature.test
    new file mode 100644
    index 0000000000..ec68a55802
    --- /dev/null
    +++ b/tests/languages/protobuf/annotation_feature.test
    @@ -0,0 +1,20 @@
    +int32 foo = 1 [deprecated=true];
    +
    +----------------------------------------------------
    +
    +[
    +	["builtin", "int32"],
    +	" foo ",
    +	["operator", "="],
    +	["number", "1"],
    +	["punctuation", "["],
    +	["annotation", "deprecated"],
    +	["operator", "="],
    +	["boolean", "true"],
    +	["punctuation", "]"],
    +	["punctuation", ";"]
    +]
    +
    +----------------------------------------------------
    +
    +Check for annotations.
    diff --git a/tests/languages/protobuf/builtin_feature.test b/tests/languages/protobuf/builtin_feature.test
    new file mode 100644
    index 0000000000..bf170b9737
    --- /dev/null
    +++ b/tests/languages/protobuf/builtin_feature.test
    @@ -0,0 +1,39 @@
    +double
    +float
    +int32
    +int64
    +uint32
    +uint64
    +sint32
    +sint64
    +fixed32
    +fixed64
    +sfixed32
    +sfixed64
    +bool
    +string
    +bytes
    +
    +----------------------------------------------------
    +
    +[
    +	["builtin", "double"],
    +	["builtin", "float"],
    +	["builtin", "int32"],
    +	["builtin", "int64"],
    +	["builtin", "uint32"],
    +	["builtin", "uint64"],
    +	["builtin", "sint32"],
    +	["builtin", "sint64"],
    +	["builtin", "fixed32"],
    +	["builtin", "fixed64"],
    +	["builtin", "sfixed32"],
    +	["builtin", "sfixed64"],
    +	["builtin", "bool"],
    +	["builtin", "string"],
    +	["builtin", "bytes"]
    +]
    +
    +----------------------------------------------------
    +
    +Check for builtin types.
    diff --git a/tests/languages/protobuf/class-name_feature.test b/tests/languages/protobuf/class-name_feature.test
    new file mode 100644
    index 0000000000..5f0ffb7351
    --- /dev/null
    +++ b/tests/languages/protobuf/class-name_feature.test
    @@ -0,0 +1,102 @@
    +syntax = "proto2";
    +syntax = "proto3";
    +
    +option java_multiple_files = true;
    +
    +import public "new.proto";
    +import "other.proto";
    +
    +enum Foo {}
    +extend Foo {}
    +service Foo {}
    +message Foo {
    +	Bar Bar = 0;
    +	foo.Bar Bar2 = 0;
    +	.baz.Bar Bar3 = 0;
    +}
    +
    +----------------------------------------------------
    +
    +[
    +	["keyword", "syntax"],
    +	["operator", "="],
    +	["string", "\"proto2\""],
    +	["punctuation", ";"],
    +
    +	["keyword", "syntax"],
    +	["operator", "="],
    +	["string", "\"proto3\""],
    +	["punctuation", ";"],
    +
    +
    +	["keyword", "option"],
    +	" java_multiple_files ",
    +	["operator", "="],
    +	["boolean", "true"],
    +	["punctuation", ";"],
    +
    +
    +	["keyword", "import"],
    +	["keyword", "public"],
    +	["string", "\"new.proto\""],
    +	["punctuation", ";"],
    +
    +	["keyword", "import"],
    +	["string", "\"other.proto\""],
    +	["punctuation", ";"],
    +
    +
    +	["keyword", "enum"],
    +	["class-name", "Foo"],
    +	["punctuation", "{"],
    +	["punctuation", "}"],
    +
    +	["keyword", "extend"],
    +	["class-name", "Foo"],
    +	["punctuation", "{"],
    +	["punctuation", "}"],
    +
    +	["keyword", "service"],
    +	["class-name", "Foo"],
    +	["punctuation", "{"],
    +	["punctuation", "}"],
    +
    +	["keyword", "message"],
    +	["class-name", "Foo"],
    +	["punctuation", "{"],
    +
    +	["positional-class-name", [
    +		"Bar"
    +	]],
    +	" Bar ",
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +
    +	["positional-class-name", [
    +		"foo",
    +		["punctuation", "."],
    +		"Bar"
    +	]],
    +	" Bar2 ",
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +
    +	["positional-class-name", [
    +		["punctuation", "."],
    +		"baz",
    +		["punctuation", "."],
    +		"Bar"
    +	]],
    +	" Bar3 ",
    +	["operator", "="],
    +	["number", "0"],
    +	["punctuation", ";"],
    +
    +	["punctuation", "}"]
    +]
    +
    +----------------------------------------------------
    +
    +Check for class names
    diff --git a/tests/languages/protobuf/keyword_feature.test b/tests/languages/protobuf/keyword_feature.test
    index eabe71e619..1272833b68 100644
    --- a/tests/languages/protobuf/keyword_feature.test
    +++ b/tests/languages/protobuf/keyword_feature.test
    @@ -1,40 +1,41 @@
    -message Point {
    -  required int32 x = 1;
    -  required int32 y = 2;
    -  optional string label = 3;
    -}
    +enum
    +extend
    +extensions
    +import
    +message
    +oneof
    +option
    +optional
    +package
    +public
    +repeated
    +required
    +reserved
    +service
    +syntax
    +to
     
     ----------------------------------------------------
     
     [
    +	["keyword", "enum"],
    +	["keyword", "extend"],
    +	["keyword", "extensions"],
    +	["keyword", "import"],
     	["keyword", "message"],
    -	" Point ",
    -	["punctuation", "{"],
    -
    -	["builtin", "required"],
    -	["primitive", "int32"],
    -	" x ",
    -	["operator", "="],
    -	["number", "1"],
    -	["punctuation", ";"],
    -
    -	["builtin", "required"],
    -	["primitive", "int32"],
    -	" y ",
    -	["operator", "="],
    -	["number", "2"],
    -	["punctuation", ";"],
    -
    -	["builtin", "optional"],
    -	["primitive", "string"],
    -	" label ",
    -	["operator", "="],
    -	["number", "3"],
    -	["punctuation", ";"],
    -
    -	["punctuation", "}"]
    +	["keyword", "oneof"],
    +	["keyword", "option"],
    +	["keyword", "optional"],
    +	["keyword", "package"],
    +	["keyword", "public"],
    +	["keyword", "repeated"],
    +	["keyword", "required"],
    +	["keyword", "reserved"],
    +	["keyword", "service"],
    +	["keyword", "syntax"],
    +	["keyword", "to"]
     ]
     
     ----------------------------------------------------
     
    -Check for keywords and builtins
    \ No newline at end of file
    +Check for keywords
    diff --git a/tests/languages/protobuf/map_feature.test b/tests/languages/protobuf/map_feature.test
    new file mode 100644
    index 0000000000..94a54f6cc4
    --- /dev/null
    +++ b/tests/languages/protobuf/map_feature.test
    @@ -0,0 +1,23 @@
    +map bar;
    +
    +----------------------------------------------------
    +
    +[
    +	["map", [
    +		"map",
    +		["punctuation", "<"],
    +		["builtin", "string"],
    +		["punctuation", ","],
    +		["punctuation", "."],
    +		"foo",
    +		["punctuation", "."],
    +		"Foo",
    +		["punctuation", ">"]
    +	]],
    +	" bar",
    +	["punctuation", ";"]
    +]
    +
    +----------------------------------------------------
    +
    +Check for maps.
    diff --git a/tests/languages/protobuf/string_feature.test b/tests/languages/protobuf/string_feature.test
    index 3d2b45cb24..8929696962 100644
    --- a/tests/languages/protobuf/string_feature.test
    +++ b/tests/languages/protobuf/string_feature.test
    @@ -20,4 +20,4 @@
     
     ----------------------------------------------------
     
    -Checks for single-quoted and double-quoted strings.
    \ No newline at end of file
    +Checks for single-quoted and double-quoted strings.