From 03cf85b024244137776e05129d9072127cf4a2b6 Mon Sep 17 00:00:00 2001
From: Michael Schmidt 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 Create a new file In this example, we choose Edit Style inheritance
![image](https://user-images.githubusercontent.com/20878432/60092675-e90e2000-9747-11e9-8b16-73bf3e219001.png)
Parameters
Creating a new language definition
+
components/prism-lang-id.js
.components/prism-foo-bar.js
.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]*)*$/
.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:
"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.
From b19f512fd3feb294f30fa918f6acad2fa6369d5b Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Sun, 30 Jun 2019 03:20:40 +0200
Subject: [PATCH 10/16] Autoloader: Fixed and improved callbacks (#1935)
This PR fixes and improves the internal Autoloader callbacks.
### Bug
Callbacks were stored in `success_callbacks` and `error_callbacks` and not removed after execution meaning once added, a callback was executed every time the language for which the callback was added for was requested (either directly or as a dependency).
This bug wasn't very visible because of how the Autoloader is usually used. Usually, the Autoloader is used to load the languages for the static code in a page. This means that the Autoloader gets asked for a bunch of languages, loads them asynchronously and then executes the callbacks with this [line](https://github.com/PrismJS/prism/blob/d4373f3a282f4c09e4fb4dcbd8885c7848b61073/plugins/autoloader/prism-autoloader.js#L187) (`success` is [this](https://github.com/PrismJS/prism/blob/d4373f3a282f4c09e4fb4dcbd8885c7848b61073/plugins/autoloader/prism-autoloader.js#L306) function). Because it takes a little while until the language is loaded (certainly until the next tick), all callbacks will be registered before the `onload` of the script is called meaning that [this](https://github.com/PrismJS/prism/blob/d4373f3a282f4c09e4fb4dcbd8885c7848b61073/plugins/autoloader/prism-autoloader.js#L300) never gets executed.
Thus the bug doesn't show up. (And even if it does, the success callback is usually just a `Prism.highlightElement` call.)
I discovered this bug when I used Autoloader to highlight C like code and then after that was done (some ticks later), I used Autoloader to highlight JavaScript code. What followed was that the synchronously called callbacks caused a stack overflow. Just a bit of good ol' infinite recursion.
I could have also fixed it by deferring callbacks to the next tick but I decided to rework the callback structure because this change of behavior might break some code. Autoloader invokes the callbacks of already loaded languages (and failed ones) synchronously while all other callbacks are called asynchronously. This fix keeps this behavior.
(It's another question as to whether we should call all callbacks asynchronously. Yes, we should IMO.)
### Improvements
1. [This](https://github.com/PrismJS/prism/blob/d4373f3a282f4c09e4fb4dcbd8885c7848b61073/plugins/autoloader/prism-autoloader.js#L218) declaration and usage of `data` is completely unnecessary and was removed.
1. Typings for `lang_data`.
---
plugins/autoloader/prism-autoloader.js | 56 ++++++++++++----------
plugins/autoloader/prism-autoloader.min.js | 2 +-
2 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js
index c1415b08c0..e5189ab7a8 100644
--- a/plugins/autoloader/prism-autoloader.js
+++ b/plugins/autoloader/prism-autoloader.js
@@ -153,6 +153,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 +223,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 +284,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 +325,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 +341,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..8b32438ad1 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
Date: Sun, 30 Jun 2019 03:42:07 +0200
Subject: [PATCH 11/16] README: Added npm downloads badge (#1934)
This adds an npm downloads/week badge to Prism's readme which also links our npm page for a little extra promotion.
---
README.md | 1 +
1 file changed, 1 insertion(+)
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/).
From 922ec555408a4631ef69c0cd1206d995edfee6f2 Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Sun, 30 Jun 2019 03:54:26 +0200
Subject: [PATCH 12/16] Website: Added basic usage for CDNs (#1924)
Per [suggestion](https://github.com/PrismJS/prism/issues/1922#issuecomment-497681398) by @foxycode, I added an example for the usage of Prism with CDNs.
---
index.html | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/index.html b/index.html
index ae717859ee..fef21c9757 100644
--- a/index.html
+++ b/index.html
@@ -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
From a16d4a25131df711aa8ba4ee07e5e0a7ef468f94 Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Sun, 30 Jun 2019 03:59:48 +0200
Subject: [PATCH 13/16] Examples improvements (#1919)
This PR makes some improvements to the examples website:
1. `fileExists` will now also check local files, so that newly added examples can be viewed.
(Requires localhost)
1. `update` now uses `Prism.highlightAllUnder` instead of the self-constructed copy of it.
1. Some formatting.
---
scripts/examples.js | 130 ++++++++++++++++++++++----------------------
1 file changed, 64 insertions(+), 66 deletions(-)
diff --git a/scripts/examples.js b/scripts/examples.js
index 5c96907601..f226f45b85 100644
--- a/scripts/examples.js
+++ b/scripts/examples.js
@@ -20,63 +20,62 @@ var treePromise = new Promise(function (resolve) {
var languages = components.languages;
-for (var id in languages) {
- if (id === 'meta') {
- continue;
- }
-
- (function (id) {
- var language = languages[id];
- var checked = false;
-
- if (language.option === 'default') {
- checked = true;
- }
+Promise.all(Object.keys(languages).filter(function (id) { return id !== 'meta'; }).map(function (id) {
+ var language = languages[id];
- language.enabled = checked;
- language.path = languages.meta.path.replace(/\{id}/g, id) + '.js';
- language.examplesPath = languages.meta.examplesPath.replace(/\{id}/g, id) + '.html';
+ language.enabled = language.option === 'default';
+ language.path = languages.meta.path.replace(/\{id}/g, id) + '.js';
+ language.examplesPath = languages.meta.examplesPath.replace(/\{id}/g, id) + '.html';
- fileExists(language.examplesPath).then(function (exists) {
- $u.element.create('label', {
- attributes: {
- 'data-id': id,
- 'title': !exists ? 'No examples are available for this language.' : ''
- },
- className: !exists ? 'unavailable' : '',
- contents: [
- {
- tag: 'input',
- properties: {
- type: 'checkbox',
- name: 'language',
- value: id,
- checked: checked && exists,
- disabled: !exists,
- onclick: function () {
- $$('input[name="' + this.name + '"]').forEach(function (input) {
- languages[input.value].enabled = input.checked;
- });
-
- update(id);
- }
+ return fileExists(language.examplesPath).then(function (exists) {
+ return { id: id, exists: exists };
+ });
+})).then(function (values) {
+ values.forEach(function (result) {
+ var id = result.id;
+ var exists = result.exists;
+ var language = languages[id];
+ var checked = language.enabled;
+
+ $u.element.create('label', {
+ attributes: {
+ 'data-id': id,
+ 'title': !exists ? 'No examples are available for this language.' : ''
+ },
+ className: !exists ? 'unavailable' : '',
+ contents: [
+ {
+ tag: 'input',
+ properties: {
+ type: 'checkbox',
+ name: 'language',
+ value: id,
+ checked: checked && exists,
+ disabled: !exists,
+ onclick: function () {
+ $$('input[name="' + this.name + '"]').forEach(function (input) {
+ languages[input.value].enabled = input.checked;
+ });
+
+ update(id);
}
- },
- language.title
- ],
- inside: '#languages'
- });
- examples[id] = $u.element.create('section', {
- 'id': 'language-' + id,
- 'className': 'language-' + id,
- inside: '#examples'
- });
- if (checked) {
- update(id);
- }
+ }
+ },
+ language.title
+ ],
+ inside: '#languages'
});
- }(id));
-}
+ examples[id] = $u.element.create('section', {
+ 'id': 'language-' + id,
+ 'className': 'language-' + id,
+ inside: '#examples'
+ });
+ if (checked) {
+ update(id);
+ }
+ });
+});
+
function fileExists(filepath) {
return treePromise.then(function (tree) {
@@ -85,6 +84,12 @@ function fileExists(filepath) {
return true;
}
}
+
+ // on localhost: The missing example might be for a new language
+ if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') {
+ return getFileContents(filepath).then(function () { return true; }, function () { return false; });
+ }
+
return false;
});
}
@@ -150,11 +155,7 @@ function update(id) {
examples[id].innerHTML = buildContentsHeader(id) + contents;
loadLanguage(id).then(function () {
- var elements = examples[id].querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
-
- for (var i=0, element; element = elements[i++];) {
- Prism.highlightElement(element);
- }
+ Prism.highlightAllUnder(examples[id]);
});
});
} else {
@@ -166,10 +167,9 @@ function update(id) {
* Loads a language, including all dependencies
*
* @param {string} lang the language to load
- * @type {Promise} the promise which resolves as soon as everything is loaded
+ * @returns {Promise} the promise which resolves as soon as everything is loaded
*/
-function loadLanguage (lang)
-{
+function loadLanguage(lang) {
// at first we need to fetch all dependencies for the main language
// Note: we need to do this, even if the main language already is loaded (just to be sure..)
//
@@ -200,12 +200,10 @@ function loadLanguage (lang)
* Returns all dependencies (as identifiers) of a specific language
*
* @param {string} lang
- * @returns {Array.} 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 [];
}
From 36a5fa0eb8bd68d90bba1bf1be0acee0061ed8d8 Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Sun, 30 Jun 2019 04:19:54 +0200
Subject: [PATCH 14/16] Known failure page (#1876)
This PR adds a known failures page. This resolves #1750.
The known failures are moved from the example pages.
(I also updated all example pages with invalid HTML.)
Some known failures were actually fixed in the meantime but never updated, so I removed a few. Those were:
- Handlebars
- Markdown's nested bold-italic
- Smarty
- Textile's "Nested styles are only partially supported"
### Screenshot
![image](https://user-images.githubusercontent.com/20878432/56849438-7eca3200-68f4-11e9-9dc3-bf0256be8d1e.png)
---
examples/prism-actionscript.html | 4 +-
examples/prism-applescript.html | 15 --
examples/prism-arduino.html | 4 +-
examples/prism-asciidoc.html | 4 +-
examples/prism-aspnet.html | 38 +--
examples/prism-autohotkey.html | 6 +-
examples/prism-autoit.html | 14 --
examples/prism-bash.html | 4 +-
examples/prism-basic.html | 4 +-
examples/prism-bison.html | 22 +-
examples/prism-brainfuck.html | 12 +-
examples/prism-bro.html | 16 +-
examples/prism-c.html | 4 +-
examples/prism-clojure.html | 10 +-
examples/prism-cpp.html | 10 +-
examples/prism-d.html | 13 --
examples/prism-elixir.html | 10 -
examples/prism-gml.html | 2 +-
examples/prism-go.html | 8 +-
examples/prism-groovy.html | 10 -
examples/prism-haml.html | 4 +-
examples/prism-handlebars.html | 10 -
examples/prism-haskell.html | 12 +-
examples/prism-inform7.html | 10 -
examples/prism-j.html | 4 +-
examples/prism-java.html | 4 +-
examples/prism-javascript.html | 14 --
examples/prism-jolie.html | 18 +-
examples/prism-less.html | 20 --
examples/prism-lua.html | 10 -
examples/prism-makefile.html | 4 +-
examples/prism-markdown.html | 17 --
examples/prism-matlab.html | 4 +-
examples/prism-mel.html | 22 +-
examples/prism-mizar.html | 12 +-
examples/prism-nasm.html | 15 --
examples/prism-nim.html | 4 +-
examples/prism-ocaml.html | 6 +-
examples/prism-opencl.html | 4 +-
examples/prism-parser.html | 20 +-
examples/prism-perl.html | 6 +-
examples/prism-php.html | 4 +-
examples/prism-powershell.html | 4 +-
examples/prism-prolog.html | 21 --
examples/prism-pug.html | 2 +-
examples/prism-puppet.html | 21 +-
examples/prism-pure.html | 8 +-
examples/prism-python.html | 10 -
examples/prism-q.html | 10 -
examples/prism-rest.html | 19 --
examples/prism-rust.html | 16 --
examples/prism-sas.html | 4 +-
examples/prism-sass.html | 19 --
examples/prism-scala.html | 13 --
examples/prism-smarty.html | 10 -
examples/prism-swift.html | 31 +--
examples/prism-textile.html | 20 --
examples/prism-twig.html | 10 -
examples/prism-vbnet.html | 4 +-
examples/prism-vhdl.html | 14 +-
examples/prism-wiki.html | 20 --
examples/prism-xojo.html | 4 +-
examples/prism-yaml.html | 2 +-
index.html | 2 +-
known-failures.html | 384 +++++++++++++++++++++++++++++++
65 files changed, 539 insertions(+), 543 deletions(-)
create mode 100644 known-failures.html
diff --git a/examples/prism-actionscript.html b/examples/prism-actionscript.html
index abb5804dbb..9ef3987ead 100644
--- a/examples/prism-actionscript.html
+++ b/examples/prism-actionscript.html
@@ -93,7 +93,7 @@ Full example
var gradientBmp:BitmapData = new BitmapData(256, 10, false, 0);
gradientBmp.draw(gradient);
RLUT = new Array(); GLUT = new Array(); BLUT = new Array();
- for (var i:int = 0; i < 256; i++) {
+ for (var i:int = 0; i < 256; i++) {
var pixelColor:uint = gradientBmp.getPixel(i, 0);
//I drew the gradient backwards, so sue me
RLUT[256-i] = pixelColor & 0xff0000;
@@ -130,4 +130,4 @@ Full example
colorBmp.paletteMap(sourceBmp, sourceBmp.rect, O, RLUT, GLUT, BLUT, null);
}
}
-}
\ No newline at end of file
+}
diff --git a/examples/prism-applescript.html b/examples/prism-applescript.html
index c88390e819..9567b87148 100644
--- a/examples/prism-applescript.html
+++ b/examples/prism-applescript.html
@@ -24,18 +24,3 @@ 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
- (* on more than
- 2 levels *)
- are *)
-not supported *)
\ No newline at end of file
diff --git a/examples/prism-arduino.html b/examples/prism-arduino.html
index 915f700f48..cc96f2657e 100644
--- a/examples/prism-arduino.html
+++ b/examples/prism-arduino.html
@@ -14,7 +14,7 @@ a < b;
+a < b;
c && d;
Full example
@@ -28,7 +28,7 @@ Full example
* runs once before everyhing else
*/
void setup() {
- pinMode(piezo, OUTPUT);
+ pinMode(piezo, OUTPUT);
}
/**
diff --git a/examples/prism-asciidoc.html b/examples/prism-asciidoc.html
index d6df3021b5..bd2aedfc84 100644
--- a/examples/prism-asciidoc.html
+++ b/examples/prism-asciidoc.html
@@ -88,7 +88,7 @@ Tables
[cols="e,m,^,>s",width="25%"]
|============================
|1 >s|2 |3 |4
-^|5 2.2+^.^|6 .3+<.>m|7
+^|5 2.2+^.^|6 .3+<.>m|7
^|8
|9 2+>|10
|============================
@@ -101,4 +101,4 @@ Inline styles
Attribute entries
:Author Initials: JB
{authorinitials}
-:Author Initials!:
\ No newline at end of file
+:Author Initials!:
diff --git a/examples/prism-aspnet.html b/examples/prism-aspnet.html
index d9c30fcf96..d65a84d85e 100644
--- a/examples/prism-aspnet.html
+++ b/examples/prism-aspnet.html
@@ -1,17 +1,17 @@
<%-- This is a comment --%>
-<%-- This is a
+<%-- This is a comment --%>
+<%-- This is a
multi-line comment --%>
Page directives
-<%@ Page Title="Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="WingtipToys.ProductList" %>
+<%@ Page Title="Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="WingtipToys.ProductList" %>
Directive tag
-<%: Page.Title %>
-<a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>">
+<%: Page.Title %>
+<a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>">
<span>
- <%#:Item.ProductName%>
+ <%#:Item.ProductName%>
</span>
Highlighted C# inside scripts
@@ -19,18 +19,18 @@ Highlighted C# inside scripts
On this page, check C# before checking ASP.NET should make
the example below work properly.
<script runat="server">
- // The following variables are visible to all procedures
- // within the script block.
- String str;
- int i;
- int i2;
+ // The following variables are visible to all procedures
+ // within the script block.
+ String str;
+ int i;
+ int i2;
- int DoubleIt(int inpt)
- {
- // The following variable is visible only within
- // the DoubleIt procedure.
- int factor = 2;
+ int DoubleIt(int inpt)
+ {
+ // The following variable is visible only within
+ // the DoubleIt procedure.
+ int factor = 2;
- return inpt * factor;
- }
-</script>
\ No newline at end of file
+ return inpt * factor;
+ }
+</script>
diff --git a/examples/prism-autohotkey.html b/examples/prism-autohotkey.html
index 620edb2eab..3e7ced7064 100644
--- a/examples/prism-autohotkey.html
+++ b/examples/prism-autohotkey.html
@@ -19,7 +19,7 @@ Full example
return
if f_class = #32770 ; It's a dialog.
{
- if f_Edit1Pos <> ; And it has an Edit1 control.
+ if f_Edit1Pos <> ; And it has an Edit1 control.
{
; Activate the window so that if the user is middle-clicking
; outside the dialog, subsequent clicks will also work:
@@ -37,7 +37,7 @@ Full example
}
else if f_class in ExploreWClass,CabinetWClass ; In Explorer, switch folders.
{
- if f_Edit1Pos <> ; And it has an Edit1 control.
+ if f_Edit1Pos <> ; And it has an Edit1 control.
{
ControlSetText, Edit1, %f_path%, ahk_id %f_window_id%
; Tekl reported the following: "If I want to change to Folder L:\folder
@@ -65,4 +65,4 @@ Full example
; 2) It's a supported type but it lacks an Edit1 control to facilitate the custom
; action, so instead do the default action below.
Run, Explorer %f_path% ; Might work on more systems without double quotes.
-return
\ No newline at end of file
+return
diff --git a/examples/prism-autoit.html b/examples/prism-autoit.html
index 51220b421c..be283a4473 100644
--- a/examples/prism-autoit.html
+++ b/examples/prism-autoit.html
@@ -36,17 +36,3 @@ 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-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-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/index.html b/index.html
index fef21c9757..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.
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''
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From de10bd1d85c8012b6f9c07866c6fb2a18f5cb567 Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Mon, 1 Jul 2019 19:55:12 +0200
Subject: [PATCH 15/16] Protobuf improvements (#1948)
This makes numerous improvements to the Protobuf grammar adding (almost) full support for PB2 and PB3 syntax.
---
components/prism-protobuf.js | 44 ++++++--
components/prism-protobuf.min.js | 2 +-
examples/prism-protobuf.html | 25 +++++
.../protobuf/annotation_feature.test | 20 ++++
tests/languages/protobuf/builtin_feature.test | 39 +++++++
.../protobuf/class-name_feature.test | 102 ++++++++++++++++++
tests/languages/protobuf/keyword_feature.test | 63 +++++------
tests/languages/protobuf/map_feature.test | 23 ++++
tests/languages/protobuf/string_feature.test | 2 +-
9 files changed, 279 insertions(+), 41 deletions(-)
create mode 100644 examples/prism-protobuf.html
create mode 100644 tests/languages/protobuf/annotation_feature.test
create mode 100644 tests/languages/protobuf/builtin_feature.test
create mode 100644 tests/languages/protobuf/class-name_feature.test
create mode 100644 tests/languages/protobuf/map_feature.test
diff --git a/components/prism-protobuf.js b/components/prism-protobuf.js
index 44e6cd5cad..4e369f84e9 100644
--- a/components/prism-protobuf.js
+++ b/components/prism-protobuf.js
@@ -1,8 +1,36 @@
-Prism.languages.protobuf = Prism.languages.extend('clike', {
- keyword: /\b(?:package|import|message|enum)\b/,
- builtin: /\b(?:required|repeated|optional|reserved)\b/,
- primitive: {
- pattern: /\b(?:double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,
- alias: 'symbol'
- }
-});
+(function (Prism) {
+
+ var builtinTypes = /\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/;
+
+ Prism.languages.protobuf = Prism.languages.extend('clike', {
+ 'class-name': {
+ pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,
+ lookbehind: true
+ },
+ 'keyword': /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/
+ });
+
+ Prism.languages.insertBefore('protobuf', 'operator', {
+ 'map': {
+ pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/,
+ alias: 'class-name',
+ inside: {
+ 'punctuation': /[<>.,]/,
+ 'builtin': builtinTypes
+ }
+ },
+ 'builtin': builtinTypes,
+ 'positional-class-name': {
+ pattern: /(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/,
+ alias: 'class-name',
+ inside: {
+ 'punctuation': /\./
+ }
+ },
+ 'annotation': {
+ pattern: /(\[\s*)[A-Za-z_]\w*(?=\s*=)/,
+ lookbehind: true
+ }
+ });
+
+}(Prism));
diff --git a/components/prism-protobuf.min.js b/components/prism-protobuf.min.js
index a55dbe2702..ffbdaee557 100644
--- a/components/prism-protobuf.min.js
+++ b/components/prism-protobuf.min.js
@@ -1 +1 @@
-Prism.languages.protobuf=Prism.languages.extend("clike",{keyword:/\b(?:package|import|message|enum)\b/,builtin:/\b(?:required|repeated|optional|reserved)\b/,primitive:{pattern:/\b(?:double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/,alias:"symbol"}});
\ No newline at end of file
+!function(e){var a=/\b(?:double|float|[su]?int(?:32|64)|s?fixed(?:32|64)|bool|string|bytes)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|service|syntax|to)\b/}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[A-Za-z_]\w*\s*[=;])/,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:a}},builtin:a,"positional-class-name":{pattern:/(?:\b|\B\.)[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s+[A-Za-z_]\w*\s*[=;])/,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[A-Za-z_]\w*(?=\s*=)/,lookbehind:!0}})}(Prism);
\ No newline at end of file
diff --git a/examples/prism-protobuf.html b/examples/prism-protobuf.html
new file mode 100644
index 0000000000..7174552d71
--- /dev/null
+++ b/examples/prism-protobuf.html
@@ -0,0 +1,25 @@
+Full example
+syntax = "proto3";
+
+package foo.generated;
+option java_package = "org.foo.generated";
+option optimize_for = SPEED;
+
+// What's up with all the foo?
+message Foo {
+
+ message Bar {
+
+ optional string key = 1;
+ optional Foo value = 2;
+ optional string value_raw = 3 [deprecated=true];
+ }
+
+ enum Level {
+ INFO = 0;
+ WARN = 1;
+ ERROR = 2;
+ }
+
+ repeated Property property = 1;
+}
diff --git a/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.
From 473f7fbd0dd82343d937cb27f9bc2ffcc683c35c Mon Sep 17 00:00:00 2001
From: Michael Schmidt
Date: Wed, 3 Jul 2019 12:34:20 +0200
Subject: [PATCH 16/16] Added support for PC-Axis file format (#1940)
This adds a new language for the PC-Axis file format.
---
components.js | 2 +-
components.json | 5 ++
components/prism-pcaxis.js | 53 +++++++++++++
components/prism-pcaxis.min.js | 1 +
examples/prism-pcaxis.html | 35 +++++++++
plugins/autoloader/prism-autoloader.js | 1 +
plugins/autoloader/prism-autoloader.min.js | 2 +-
plugins/show-language/prism-show-language.js | 2 +
.../show-language/prism-show-language.min.js | 2 +-
tests/languages/pcaxis/boolean_feature.test | 13 ++++
tests/languages/pcaxis/keyword_feature.test | 76 +++++++++++++++++++
tests/languages/pcaxis/number_feature.test | 17 +++++
tests/languages/pcaxis/string_feature.test | 13 ++++
tests/languages/pcaxis/tlist_feature.test | 72 ++++++++++++++++++
14 files changed, 291 insertions(+), 3 deletions(-)
create mode 100644 components/prism-pcaxis.js
create mode 100644 components/prism-pcaxis.min.js
create mode 100644 examples/prism-pcaxis.html
create mode 100644 tests/languages/pcaxis/boolean_feature.test
create mode 100644 tests/languages/pcaxis/keyword_feature.test
create mode 100644 tests/languages/pcaxis/number_feature.test
create mode 100644 tests/languages/pcaxis/string_feature.test
create mode 100644 tests/languages/pcaxis/tlist_feature.test
diff --git a/components.js b/components.js
index 04b6666693..cddd646c67 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"},"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"},"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 2f8c5a6080..37fa5139c5 100644
--- a/components.json
+++ b/components.json
@@ -632,6 +632,11 @@
},
"owner": "Golmote"
},
+ "pcaxis": {
+ "title": "PC-Axis",
+ "alias": "px",
+ "owner": "RunDevelopment"
+ },
"perl": {
"title": "Perl",
"owner": "Golmote"
diff --git a/components/prism-pcaxis.js b/components/prism-pcaxis.js
new file mode 100644
index 0000000000..1ce0ba1043
--- /dev/null
+++ b/components/prism-pcaxis.js
@@ -0,0 +1,53 @@
+Prism.languages.pcaxis = {
+ 'string': /"[^"]*"/,
+ 'keyword': {
+ pattern: /((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,
+ lookbehind: true,
+ greedy: true,
+ inside: {
+ 'keyword': /^[-A-Z\d]+/,
+ 'language': {
+ pattern: /^(\s*)\[[-\w]+\]/,
+ lookbehind: true,
+ inside: {
+ 'punctuation': /^\[|\]$/,
+ 'property': /[-\w]+/
+ }
+ },
+ 'sub-key': {
+ pattern: /^(\s*)[\s\S]+/,
+ lookbehind: true,
+ inside: {
+ 'parameter': {
+ pattern: /"[^"]*"/,
+ alias: 'property'
+ },
+ 'punctuation': /^\(|\)$|,/
+ }
+ }
+ }
+ },
+ 'operator': /=/,
+ 'tlist': {
+ pattern: /TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,
+ greedy: true,
+ inside: {
+ 'function': /^TLIST/,
+ 'property': {
+ pattern: /^(\s*\(\s*)\w+/,
+ lookbehind: true
+ },
+ 'string': /"[^"]*"/,
+ 'punctuation': /[(),]/,
+ 'operator': /-/
+ }
+ },
+ 'punctuation': /[;,]/,
+ 'number': {
+ pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/,
+ lookbehind: true
+ },
+ 'boolean': /YES|NO/,
+};
+
+Prism.languages.px = Prism.languages.pcaxis;
diff --git a/components/prism-pcaxis.min.js b/components/prism-pcaxis.min.js
new file mode 100644
index 0000000000..89ef4484f6
--- /dev/null
+++ b/components/prism-pcaxis.min.js
@@ -0,0 +1 @@
+Prism.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)[\s\S]+/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/YES|NO/},Prism.languages.px=Prism.languages.pcaxis;
\ No newline at end of file
diff --git a/examples/prism-pcaxis.html b/examples/prism-pcaxis.html
new file mode 100644
index 0000000000..59ab31141d
--- /dev/null
+++ b/examples/prism-pcaxis.html
@@ -0,0 +1,35 @@
+Full example
+CHARSET="ANSI";
+AXIS-VERSION="2000";
+LANGUAGE="en";
+CREATION-DATE="20170406 11:08";
+TIMEVAL("time")=TLIST(A1, "1994"-"1996");
+SUBJECT-AREA="";
+UNITS="Number";
+
+STUB="County","Sex";
+VALUES("County")="State","Carlow","Dublin","Kildare","Kilkenny","Laois","Longford","Louth","Meath","Offaly","Westmeath","Wexford",
+"Wicklow","Clare","Cork","Kerry","Limerick","Tipperary","Waterford","Galway","Leitrim","Mayo","Roscommon","Sligo","Cavan",
+"Donegal","Monaghan";
+VALUES("Sex")="Both sexes","Male","Female";
+VALUES[de]("Sex")="Beide Geschlechter","Mann","Frau";
+CODES("County")="-","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26";
+CODES("Sex")="-","1","2";
+
+DATA=
+47163 87913 70192 84531 93120 343 5911 47038 51126 47870 95976 5643 66043 38987 63125 46882
+57422 89992 11661 35817 92686 21781 37230 80669 14129 56688 81300 20184 88680 52135 17148 28192
+92218 99175 76054 79907 90207 50547 31522 4244 91079 58776 83402 54109 21254 42946 83519 31242
+10925 37377 45279 19704 96633 51732 34458 9746 91761 42687 51681 54409 61058 74227 70802 34546
+64862 12022 29896 23616 50371 89808 57186 63895 94767 76388 66475 56716 50133 6604 52853 40763
+70558 74672 58190 40909 6869 49937 9271 28067 99656 25674 69442 20608 28046 73287 60416 77515
+51639 15516 40968 95524 6694 12956 83150 77099 45687 27241 6492 94966 36856 60693 720 74671
+17309 4831 69376 67757 67499 69029 5209 50738 86947 77747 10996 9167 69176 98856 29531 5865
+27654 52277 62293 30179 85049 76961 92772 65142 16252 6768 55784 20556 26088 97219 97245 44060
+64577 91018 75157 42780 96186 62948 73288 74597 2145 16047 1671 2690 2275 45398 71478 53720
+94832 91800 10398 84830 6009 9024 53132 97850 63832 13269 45376 38564 60343 85293 9330 16810
+24898 76675 32778 26905 40945 37569 43532 38650 38316 75398 60829 91004 97946 49080 93534 78275
+20002 87183 80802 56487 12666 18416 91632 74573 70729 97984 48479 93014 10281 90382 28497 15366
+29720 25646 98513 47065 37662 94058 17383 47234 87293 37849 32087 98641 62012 12584 35492 87090
+85157 90539 31005 67590 13627 44803 46789 8026 86877 18429 8935 78118 41728 67025 69312 52172
+49224 68064 93025 1195 64873 684 90039 86065 67324 66534 1110 22354 36867 27479 76286 8539
diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js
index e5189ab7a8..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",
diff --git a/plugins/autoloader/prism-autoloader.min.js b/plugins/autoloader/prism-autoloader.min.js
index 8b32438ad1..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 r={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"},n={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"},l={},a=document.getElementsByTagName("script"),e="components/";if((a=a[a.length-1]).hasAttribute("data-autoloader-path")){var t=a.getAttribute("data-autoloader-path").trim();0