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..ad8ee5b513 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..275a858f3b 100644
--- a/components.json
+++ b/components.json
@@ -635,6 +635,10 @@
"pascaligo": {
"title": "Pascaligo",
"owner": "DefinitelyNotAGoat"
+ "pcaxis": {
+ "title": "PC-Axis",
+ "alias": "px",
+ "owner": "RunDevelopment"
},
"perl": {
"title": "Perl",
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(/ 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.
-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
-Comments only support one level of nesting
-
\ 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 @@ (* Nested block
- (* comments
- (* on more than
- 2 levels *)
- are *)
-not supported *)
Booleans
false;
Operators
-
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 @@
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
@@ -101,4 +101,4 @@ [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
|============================
Inline styles
Attribute entries
\ No newline at end of file
+:Author Initials!::Author Initials: JB
{authorinitials}
-:Author Initials!:
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 @@ 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. -
- -#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 @@ 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 @@ 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. -
- -{
- 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 @@ ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
+++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
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 @@ 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. -
- -/+ /+ /+ this does not work +/ +/ +/
-
-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 @@ 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. -
- -'#{: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 @@ 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"
func(a, b int, z float64) bool { return a*b < int(z) }
+func(a, b int, z float64) bool { return a*b < int(z) }
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 @@ 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. -
- -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 @@ %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 @@ 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. -
- -<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 @@ 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 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 @@ 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 @@ 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. -
- -`${ /* } */ a + b }`
-`${ '}' }`
-
-`${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 @@ 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. -
- -@import "some file.less";
-
-@import "@{themes}/tidal-wave.less";
-
-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 @@ 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. -
- -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 @@ 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. -
- -_ **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 @@ 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 @@ 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. -
- -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 @@ 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. -
- -# Doesn't work
-# Does work
- # Does work when prefixed with a space
-
-^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 @@
+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 @@ # This is a comment
-<# This is a
+<# This is a
multi-line comment #>
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. -
- -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 @@
+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 @@ require apache
template('apache/vhost-default.conf.erb')
-[1,20,3].filter |$value| { $value < 10 }
+[1,20,3].filter |$value| { $value < 10 }
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],
}
-
-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. -
- -"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 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 @@ 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. -
- -{
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 @@ 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. -
- -\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 @@ 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. -
- -+---------------+----------+
-| column 1 | column 2 |
-+--------------+-----------+
-| **bold**? | *italic*? |
-+--------------+-----------+
-
-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 @@ 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
- are */
-not supported */
-
-|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 @@ 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 @@ 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. -
- -.page
- color = 5px + 9px
-
-!width = 13px
-.icon
- width = !width
-
-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 @@ 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
- 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 @@ 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. -
- -<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 @@ 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
+ /* ... */
}
-
-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
- 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 @@ 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. -
- -Only one level of nesting is supported.
- -*A bold paragraph %containing a span with broken _italic_ inside%!*
-
-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 @@ 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. -
- -<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 @@ 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 @@ 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";
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. -
- -{{#switch:{{PAGENAME}}
-| L'Aquila = No translation
-| L = Not OK
-| L'Aquila = Entity escaping
-| L'Aquila = Numeric char encoding
-}}
-
-''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 @@ 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.
+
-
-
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]*)*$/
.
-
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
-
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
.
-
Write the language definition.
The above section already explains the makeup of language definitions.
+ -
+
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"
+}
+
-
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
-
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.)
-
Carefully check that the token stream JSON you just inserted is what you expect.
- - Re-run
npm run test:languages -- --language=lang-id --pretty
to verify that the test passes.
+ - 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.