Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mozilla/kuma
...
head fork: mozilla/kuma
compare: 39d7db88dbdd074a6f295c2932734489a8973bc1
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 43 files changed
  • 0 commit comments
  • 2 contributors
Showing with 2,074 additions and 28 deletions.
  1. +4 −0 apps/wiki/templates/wiki/confirm_revision_revert.html
  2. +1 −0  apps/wiki/templates/wiki/document.html
  3. +121 −0 apps/wiki/templates/wiki/includes/highlighting_scripts.html
  4. +3 −0  media/css/wiki-screen.css
  5. +0 −16 media/js/wiki.js
  6. +13 −0 media/prism/components/prism-clike.js
  7. +1 −0  media/prism/components/prism-clike.min.js
  8. +22 −0 media/prism/components/prism-coffeescript.js
  9. +1 −0  media/prism/components/prism-coffeescript.min.js
  10. +345 −0 media/prism/components/prism-core.js
  11. +5 −0 media/prism/components/prism-core.min.js
  12. +26 −0 media/prism/components/prism-css.js
  13. +1 −0  media/prism/components/prism-css.min.js
  14. +8 −0 media/prism/components/prism-java.js
  15. +1 −0  media/prism/components/prism-java.min.js
  16. +26 −0 media/prism/components/prism-javascript.js
  17. +1 −0  media/prism/components/prism-javascript.min.js
  18. +41 −0 media/prism/components/prism-markup.js
  19. +1 −0  media/prism/components/prism-markup.min.js
  20. +36 −0 media/prism/components/prism-scss.js
  21. +1 −0  media/prism/components/prism-scss.min.js
  22. +69 −0 media/prism/plugins/autolinker/index.html
  23. +3 −0  media/prism/plugins/autolinker/prism-autolinker.css
  24. +61 −0 media/prism/plugins/autolinker/prism-autolinker.js
  25. +1 −0  media/prism/plugins/autolinker/prism-autolinker.min.js
  26. +67 −0 media/prism/plugins/ie8/index.html
  27. +3 −0  media/prism/plugins/ie8/prism-ie8.css
  28. +42 −0 media/prism/plugins/ie8/prism-ie8.js
  29. +1 −0  media/prism/plugins/ie8/prism-ie8.min.js
  30. +41 −0 media/prism/plugins/index.html
  31. +87 −0 media/prism/plugins/line-highlight/index.html
  32. +47 −0 media/prism/plugins/line-highlight/prism-line-highlight.css
  33. +94 −0 media/prism/plugins/line-highlight/prism-line-highlight.js
  34. +1 −0  media/prism/plugins/line-highlight/prism-line-highlight.min.js
  35. +45 −0 media/prism/plugins/show-invisibles/index.html
  36. +17 −0 media/prism/plugins/show-invisibles/prism-show-invisibles.css
  37. +15 −0 media/prism/plugins/show-invisibles/prism-show-invisibles.js
  38. +1 −0  media/prism/plugins/show-invisibles/prism-show-invisibles.min.js
  39. +111 −0 media/prism/prism-dark.css
  40. +100 −0 media/prism/prism-funky.css
  41. +107 −0 media/prism/prism.css
  42. +503 −0 media/prism/prism.js
  43. +0 −12 settings.py
View
4 apps/wiki/templates/wiki/confirm_revision_revert.html
@@ -40,3 +40,7 @@ <h1 class="title">{{ _('Are you sure you want to revert to this revision?') }}</
</div>
</section>
{% endblock %}
+
+{% block js %}
+ {% include 'wiki/includes/highlighting_scripts.html' %}
+{% endblock %}
View
1  apps/wiki/templates/wiki/document.html
@@ -344,4 +344,5 @@ <h1 class="page-title">{{ document.title }}</h1>
{% block js %}
{% include 'wiki/includes/ckeditor_scripts.html' %}
+ {% include 'wiki/includes/highlighting_scripts.html' %}
{% endblock %}
View
121 apps/wiki/templates/wiki/includes/highlighting_scripts.html
@@ -0,0 +1,121 @@
+<!-- include syntax highlighting scripts -->
+{% if waffle.flag('prism_highlighter') %}
+
+ <link rel="stylesheet" href="{{ MEDIA_URL }}prism/prism.css" type="text/css" />
+ <link rel="stylesheet" href="{{ MEDIA_URL }}prism/plugins/line-highlight/prism-line-highlight.css" type="text/css" />
+ <link rel="stylesheet" href="{{ MEDIA_URL }}prism/plugins/ie8/prism-ie8.css" type="text/css" />
+
+ <script type="text/javascript" src="{{ MEDIA_URL }}prism/prism.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}prism/plugins/ie8/prism-ie8.js"></script>
+ <script type="text/javascript">
+ (function($) {
+ // Fudge a few languages
+ var languages = Prism.languages;
+ languages.xml = languages.xul = languages.html = languages.markup;
+ languages.js = languages.json = languages.javascript;
+ languages.cpp = languages.clike;
+
+ // Hacks to make this work in IE8 :(
+ if (!('forEach' in Array.prototype)) {
+ patchIE8ForPrism();
+ }
+ else {
+ // Capable browsers get syntax highlighting because
+ // querySelectorAll isn't easily patchable
+ var script = document.createElement('script');
+ script.src = '/media/prism/plugins/line-highlight/prism-line-highlight.js';
+ document.body.appendChild(script);
+ }
+
+ // Treat and highlight PRE elements!
+ $('pre').each(function() {
+ var $pre = $(this),
+ defaultBrush = 'html',
+ klass = $.trim($pre.attr('class')),
+ // Split on ';' to accommodate for old line numbering
+ semiSplit = klass.split(';'),
+ klassParts = semiSplit[0].split(':');
+
+ // Default to HTML styling for all PRE's (and unsupported languages)
+ $pre.attr('class', 'language-' + defaultBrush);
+
+ // Format PRE content for Prism highlighting
+ if(klassParts[0] == 'brush') {
+ var brush = $.trim(klassParts[1].toLowerCase());
+ $pre.html('<code class="language-' + (languages[brush] ? brush : defaultBrush) + '">' + $.trim($pre.html()) + '</code>');
+ }
+
+ // Accommodate for line-highlighting
+ // highlight:[8,9,10,11,17,18,19,20]
+ if(semiSplit.length > 1) {
+ var lines = semiSplit[1].match(/\[(.*)\]/);
+ if(lines && lines.length > 1) {
+ $pre.attr('data-line', lines[1]);
+ }
+ }
+ });
+
+ // Patch for IE8 so that Prism works
+ function patchIE8ForPrism() {
+
+ // Add Array map
+ Array.prototype.map = function(callback, thisArg) {
+ var T, A, k, O = Object(this), len = O.length >>> 0;
+ if (thisArg) {
+ T = thisArg;
+ }
+ A = new Array(len);
+ k = 0;
+ while(k < len) {
+ var kValue, mappedValue;
+ if (k in O) {
+ kValue = O[ k ];
+ mappedValue = callback.call(T, kValue, k, O);
+ A[ k ] = mappedValue;
+ }
+ k++;
+ }
+ return A;
+ };
+
+ // Add forEach map
+ Array.prototype.forEach = function(action, that) {
+ for (var i = 0, n = this.length; i < n; i++) {
+ if (i in this) {
+ action.call(that, this[i], i, this);
+ }
+ }
+ };
+ }
+ })(jQuery);
+ </script>
+{% else %}
+
+ <link rel="stylesheet" href="{{ MEDIA_URL }}syntaxhighlighter/styles/shCore.css" type="text/css" />
+ <link rel="stylesheet" href="{{ MEDIA_URL }}syntaxhighlighter/styles/shThemeDefault.css" type="text/css" />
+
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shCore.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushBash.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushCpp.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushCss.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushJava.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushJScript.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushPhp.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushXml.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushPlain.js"></script>
+ <script type="text/javascript" src="{{ MEDIA_URL }}syntaxhighlighter/scripts/shBrushPython.js"></script>
+ <script type="text/javascript">
+ (function($) {
+ $(document).ready(function() {
+ $('pre').each(function() {
+ var $this = $(this),
+ newText = $this.text().replace(/<span class="nowiki">(.*)<\/span>/g, '$1');
+ $this.text(newText);
+ });
+ SyntaxHighlighter.defaults.toolbar = false;
+ SyntaxHighlighter.defaults['auto-links'] = false;
+ SyntaxHighlighter.all();
+ });
+ })(jQuery);
+ </script>
+{% endif %}
View
3  media/css/wiki-screen.css
@@ -550,6 +550,9 @@ td.diff_header {
width: auto !important;
}
+/* Prism syntax highlighting */
+pre[class*="language-"] { line-height: 1.5em; margin-bottom: 20px !important; }
+.error pre[class*="language-"] { margin: 10px 0 0 0 !important; background: none; }
/* HTabs - Compatibility Tables */
.htab { margin: 0 auto 1em; display: inline-block; }
View
16 media/js/wiki.js
@@ -44,14 +44,9 @@
initApproveReject();
}
if ($body.is('.document')){
- initSyntaxHighlighter();
initTabBox();
}
- if ($body.is('.revert-document')) {
- initSyntaxHighlighter();
- }
-
if ($body.is('.home')) {
initClearOddSections();
}
@@ -622,17 +617,6 @@
});
}
- function initSyntaxHighlighter() {
- $('pre').each(function() {
- var $this = $(this),
- newText = $this.text().replace(/<span class="nowiki">(.*)<\/span>/g, '$1');
- $this.text(newText);
- });
- SyntaxHighlighter.defaults.toolbar = false;
- SyntaxHighlighter.defaults['auto-links'] = false;
- SyntaxHighlighter.all();
- }
-
// Return a table of contents (an <ol>) listing the visible headers within
// elements in the $pageBody set.
//
View
13 media/prism/components/prism-clike.js
@@ -0,0 +1,13 @@
+Prism.languages.clike = {
+ 'comment': {
+ pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|[^:]\/\/.*?(\r?\n|$))/g,
+ lookbehind: true
+ },
+ 'string': /("|')(\\?.)*?\1/g,
+ 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,
+ 'boolean': /\b(true|false)\b/g,
+ 'number': /\b-?(0x)?\d*\.?[\da-f]+\b/g,
+ 'operator': /[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g,
+ 'ignore': /&(lt|gt|amp);/gi,
+ 'punctuation': /[{}[\];(),.:]/g
+};
View
1  media/prism/components/prism-clike.min.js
@@ -0,0 +1 @@
+Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|[^:]\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,number:/\b-?(0x)?\d*\.?[\da-f]+\b/g,operator:/[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};
View
22 media/prism/components/prism-coffeescript.js
@@ -0,0 +1,22 @@
+Prism.languages.coffeescript = Prism.languages.extend('javascript', {
+ 'block-comment': /([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,
+ 'comment': /(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,
+ 'keyword': /\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g,
+});
+
+Prism.languages.insertBefore('coffeescript', 'keyword', {
+ 'function': {
+ pattern: /[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*-&gt;/gi,
+ inside: {
+ 'function-name': /[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,
+ 'operator': /[-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\//g
+ }
+ },
+
+ 'class-name': {
+ pattern: /(class\s+)[a-z-]+[\.a-z]*\s/gi,
+ lookbehind: true
+ },
+
+ 'attr-name': /[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g
+});
View
1  media/prism/components/prism-coffeescript.min.js
@@ -0,0 +1 @@
+Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*->/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g}},"class-name":{pattern:/(class\s+)[a-z-]+[\.a-z]*\s/gi,lookbehind:true},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g})
View
345 media/prism/components/prism-core.js
@@ -0,0 +1,345 @@
+/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ */
+
+(function(){
+
+// Private helper vars
+var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i;
+
+var _ = self.Prism = {
+ util: {
+ type: function (o) {
+ return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1];
+ },
+
+ // Deep clone a language definition (e.g. to extend it)
+ clone: function (o) {
+ var type = _.util.type(o);
+
+ switch (type) {
+ case 'Object':
+ var clone = {};
+
+ for (var key in o) {
+ if (o.hasOwnProperty(key)) {
+ clone[key] = _.util.clone(o[key]);
+ }
+ }
+
+ return clone;
+
+ case 'Array':
+ return o.slice();
+ }
+
+ return o;
+ }
+ },
+
+ languages: {
+ extend: function (id, redef) {
+ var lang = _.util.clone(_.languages[id]);
+
+ for (var key in redef) {
+ lang[key] = redef[key];
+ }
+
+ return lang;
+ },
+
+ // Insert a token before another token in a language literal
+ insertBefore: function (inside, before, insert, root) {
+ root = root || _.languages;
+ var grammar = root[inside];
+ var ret = {};
+
+ for (var token in grammar) {
+
+ if (grammar.hasOwnProperty(token)) {
+
+ if (token == before) {
+
+ for (var newToken in insert) {
+
+ if (insert.hasOwnProperty(newToken)) {
+ ret[newToken] = insert[newToken];
+ }
+ }
+ }
+
+ ret[token] = grammar[token];
+ }
+ }
+
+ return root[inside] = ret;
+ },
+
+ // Traverse a language definition with Depth First Search
+ DFS: function(o, callback) {
+ for (var i in o) {
+ callback.call(o, i, o[i]);
+
+ if (_.util.type(o) === 'Object') {
+ _.languages.DFS(o[i], callback);
+ }
+ }
+ }
+ },
+
+ highlightAll: function(async, callback) {
+ var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');
+
+ for (var i=0, element; element = elements[i++];) {
+ _.highlightElement(element, async === true, callback);
+ }
+ },
+
+ highlightElement: function(element, async, callback) {
+ // Find language
+ var language, grammar, parent = element;
+
+ while (parent && !lang.test(parent.className)) {
+ parent = parent.parentNode;
+ }
+
+ if (parent) {
+ language = (parent.className.match(lang) || [,''])[1];
+ grammar = _.languages[language];
+ }
+
+ if (!grammar) {
+ return;
+ }
+
+ // Set language on the element, if not present
+ element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
+
+ // Set language on the parent, for styling
+ parent = element.parentNode;
+
+ if (/pre/i.test(parent.nodeName)) {
+ parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
+ }
+
+ var code = element.textContent;
+
+ if(!code) {
+ return;
+ }
+
+ code = code.replace(/&/g, '&amp;').replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;').replace(/\u00a0/g, ' ');
+ //console.time(code.slice(0,50));
+
+ var env = {
+ element: element,
+ language: language,
+ grammar: grammar,
+ code: code
+ };
+
+ _.hooks.run('before-highlight', env);
+
+ if (async && self.Worker) {
+ var worker = new Worker(_.filename);
+
+ worker.onmessage = function(evt) {
+ env.highlightedCode = Token.stringify(JSON.parse(evt.data));
+ env.element.innerHTML = env.highlightedCode;
+
+ callback && callback.call(env.element);
+ //console.timeEnd(code.slice(0,50));
+ _.hooks.run('after-highlight', env);
+ };
+
+ worker.postMessage(JSON.stringify({
+ language: env.language,
+ code: env.code
+ }));
+ }
+ else {
+ env.highlightedCode = _.highlight(env.code, env.grammar)
+ env.element.innerHTML = env.highlightedCode;
+
+ callback && callback.call(element);
+
+ _.hooks.run('after-highlight', env);
+ //console.timeEnd(code.slice(0,50));
+ }
+ },
+
+ highlight: function (text, grammar) {
+ return Token.stringify(_.tokenize(text, grammar));
+ },
+
+ tokenize: function(text, grammar) {
+ var Token = _.Token;
+
+ var strarr = [text];
+
+ var rest = grammar.rest;
+
+ if (rest) {
+ for (var token in rest) {
+ grammar[token] = rest[token];
+ }
+
+ delete grammar.rest;
+ }
+
+ tokenloop: for (var token in grammar) {
+ if(!grammar.hasOwnProperty(token) || !grammar[token]) {
+ continue;
+ }
+
+ var pattern = grammar[token],
+ inside = pattern.inside,
+ lookbehind = !!pattern.lookbehind || 0;
+
+ pattern = pattern.pattern || pattern;
+
+ for (var i=0; i<strarr.length; i++) { // Don’t cache length as it changes during the loop
+
+ var str = strarr[i];
+
+ if (strarr.length > text.length) {
+ // Something went terribly wrong, ABORT, ABORT!
+ break tokenloop;
+ }
+
+ if (str instanceof Token) {
+ continue;
+ }
+
+ pattern.lastIndex = 0;
+
+ var match = pattern.exec(str);
+
+ if (match) {
+ if(lookbehind) {
+ lookbehind = match[1].length;
+ }
+
+ var from = match.index - 1 + lookbehind,
+ match = match[0].slice(lookbehind),
+ len = match.length,
+ to = from + len,
+ before = str.slice(0, from + 1),
+ after = str.slice(to + 1);
+
+ var args = [i, 1];
+
+ if (before) {
+ args.push(before);
+ }
+
+ var wrapped = new Token(token, inside? _.tokenize(match, inside) : match);
+
+ args.push(wrapped);
+
+ if (after) {
+ args.push(after);
+ }
+
+ Array.prototype.splice.apply(strarr, args);
+ }
+ }
+ }
+
+ return strarr;
+ },
+
+ hooks: {
+ all: {},
+
+ add: function (name, callback) {
+ var hooks = _.hooks.all;
+
+ hooks[name] = hooks[name] || [];
+
+ hooks[name].push(callback);
+ },
+
+ run: function (name, env) {
+ var callbacks = _.hooks.all[name];
+
+ if (!callbacks || !callbacks.length) {
+ return;
+ }
+
+ for (var i=0, callback; callback = callbacks[i++];) {
+ callback(env);
+ }
+ }
+ }
+};
+
+var Token = _.Token = function(type, content) {
+ this.type = type;
+ this.content = content;
+};
+
+Token.stringify = function(o) {
+ if (typeof o == 'string') {
+ return o;
+ }
+
+ if (Object.prototype.toString.call(o) == '[object Array]') {
+ return o.map(Token.stringify).join('');
+ }
+
+ var env = {
+ type: o.type,
+ content: Token.stringify(o.content),
+ tag: 'span',
+ classes: ['token', o.type],
+ attributes: {}
+ };
+
+ if (env.type == 'comment') {
+ env.attributes['spellcheck'] = 'true';
+ }
+
+ _.hooks.run('wrap', env);
+
+ var attributes = '';
+
+ for (var name in env.attributes) {
+ attributes += name + '="' + (env.attributes[name] || '') + '"';
+ }
+
+ return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>';
+
+};
+
+if (!self.document) {
+ // In worker
+ self.addEventListener('message', function(evt) {
+ var message = JSON.parse(evt.data),
+ lang = message.language,
+ code = message.code;
+
+ self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang])));
+ self.close();
+ }, false);
+
+ return;
+}
+
+// Get current script and highlight
+var script = document.getElementsByTagName('script');
+
+script = script[script.length - 1];
+
+if (script) {
+ _.filename = script.src;
+
+ if (document.addEventListener && !script.hasAttribute('data-manual')) {
+ document.addEventListener('DOMContentLoaded', _.highlightAll);
+ }
+}
+
+})();
View
5 media/prism/components/prism-core.min.js
@@ -0,0 +1,5 @@
+/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data));l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r){return n.stringify(t.tokenize(e,r))},tokenize:function(e,n){var r=t.Token,i=[e],s=n.rest;if(s){for(var o in s)n[o]=s[o];delete n.rest}e:for(var o in n){if(!n.hasOwnProperty(o)||!n[o])continue;var u=n[o],a=u.inside,f=!!u.lookbehind||0;u=u.pattern||u;for(var l=0;l<i.length;l++){var c=i[l];if(i.length>e.length)break e;if(c instanceof r)continue;u.lastIndex=0;var h=u.exec(c);if(h){f&&(f=h[1].length);var p=h.index-1+f,h=h[0].slice(f),d=h.length,v=p+d,m=c.slice(0,p+1),g=c.slice(v+1),y=[l,1];m&&y.push(m);var b=new r(o,a?t.tokenize(h,a):h);y.push(b);g&&y.push(g);Array.prototype.splice.apply(i,y)}}}return i},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(n.stringify).join("");var r={type:e.type,content:n.stringify(e.content),tag:"span",classes:["token",e.type],attributes:{}};r.type=="comment"&&(r.attributes.spellcheck="true");t.hooks.run("wrap",r);var i="";for(var s in r.attributes)i+=s+'="'+(r.attributes[s]||"")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'" '+i+">"+r.content+"</"+r.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();
View
26 media/prism/components/prism-css.js
@@ -0,0 +1,26 @@
+Prism.languages.css = {
+ 'comment': /\/\*[\w\W]*?\*\//g,
+ 'atrule': /@[\w-]+?(\s+[^;{]+)?(?=\s*{|\s*;)/gi,
+ 'url': /url\((["']?).*?\1\)/gi,
+ 'selector': /[^\{\}\s][^\{\}]*(?=\s*\{)/g,
+ 'property': /(\b|\B)[a-z-]+(?=\s*:)/ig,
+ 'string': /("|')(\\?.)*?\1/g,
+ 'important': /\B!important\b/gi,
+ 'ignore': /&(lt|gt|amp);/gi,
+ 'punctuation': /[\{\};:]/g
+};
+
+if (Prism.languages.markup) {
+ Prism.languages.insertBefore('markup', 'tag', {
+ 'style': {
+ pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,
+ inside: {
+ 'tag': {
+ pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,
+ inside: Prism.languages.markup.tag.inside
+ },
+ rest: Prism.languages.css
+ }
+ }
+ });
+}
View
1  media/prism/components/prism-css.min.js
@@ -0,0 +1 @@
+Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:/@[\w-]+?(\s+[^;{]+)?(?=\s*{|\s*;)/gi,url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\}]*(?=\s*\{)/g,property:/(\b|\B)[a-z-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});
View
8 media/prism/components/prism-java.js
@@ -0,0 +1,8 @@
+Prism.languages.java = Prism.languages.extend('clike', {
+ 'keyword': /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g,
+ 'number': /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+[e]?[\d]*[df]\b|\W\d*\.?\d+\b/gi,
+ 'operator': {
+ pattern: /([^\.]|^)([-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\/|%|\^|(&lt;){2}|($gt;){2,3}|:|~)/g,
+ lookbehind: true
+ }
+});
View
1  media/prism/components/prism-java.min.js
@@ -0,0 +1 @@
+Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+[e]?[\d]*[df]\b|\W\d*\.?\d+\b/gi,operator:{pattern:/([^\.]|^)([-+]{1,2}|!|=?&lt;|=?&gt;|={1,2}|(&amp;){1,2}|\|?\||\?|\*|\/|%|\^|(&lt;){2}|($gt;){2,3}|:|~)/g,lookbehind:!0}});
View
26 media/prism/components/prism-javascript.js
@@ -0,0 +1,26 @@
+Prism.languages.javascript = Prism.languages.extend('clike', {
+ 'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,
+ 'number': /\b(-?(0x)?\d*\.?[\da-f]+|NaN|-?Infinity)\b/g,
+});
+
+Prism.languages.insertBefore('javascript', 'keyword', {
+ 'regex': {
+ pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
+ lookbehind: true
+ }
+});
+
+if (Prism.languages.markup) {
+ Prism.languages.insertBefore('markup', 'tag', {
+ 'script': {
+ pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,
+ inside: {
+ 'tag': {
+ pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,
+ inside: Prism.languages.markup.tag.inside
+ },
+ rest: Prism.languages.javascript
+ }
+ }
+ });
+}
View
1  media/prism/components/prism-javascript.min.js
@@ -0,0 +1 @@
+Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b(-?(0x)?\d*\.?[\da-f]+|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});
View
41 media/prism/components/prism-markup.js
@@ -0,0 +1,41 @@
+Prism.languages.markup = {
+ 'comment': /&lt;!--[\w\W]*?--(&gt;|&gt;)/g,
+ 'prolog': /&lt;\?.+?\?&gt;/,
+ 'doctype': /&lt;!DOCTYPE.+?&gt;/,
+ 'cdata': /&lt;!\[CDATA\[[\w\W]*?]]&gt;/i,
+ 'tag': {
+ pattern: /&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?&gt;/gi,
+ inside: {
+ 'tag': {
+ pattern: /^&lt;\/?[\w:-]+/i,
+ inside: {
+ 'punctuation': /^&lt;\/?/,
+ 'namespace': /^[\w-]+?:/
+ }
+ },
+ 'attr-value': {
+ pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,
+ inside: {
+ 'punctuation': /=|&gt;|"/g
+ }
+ },
+ 'punctuation': /\/?&gt;/g,
+ 'attr-name': {
+ pattern: /[\w:-]+/g,
+ inside: {
+ 'namespace': /^[\w-]+?:/
+ }
+ }
+
+ }
+ },
+ 'entity': /&amp;#?[\da-z]{1,8};/gi
+};
+
+// Plugin to make entity title show the real entity, idea by Roman Komarov
+Prism.hooks.add('wrap', function(env) {
+
+ if (env.type === 'entity') {
+ env.attributes['title'] = env.content.replace(/&amp;/, '&');
+ }
+});
View
1  media/prism/components/prism-markup.min.js
@@ -0,0 +1 @@
+Prism.languages.markup={comment:/&lt;!--[\w\W]*?--(&gt;|&gt;)/g,prolog:/&lt;\?.+?\?&gt;/,doctype:/&lt;!DOCTYPE.+?&gt;/,cdata:/&lt;!\[CDATA\[[\w\W]+?]]&gt;/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?&gt;/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|&gt;|"/g}},punctuation:/\/?&gt;/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});
View
36 media/prism/components/prism-scss.js
@@ -0,0 +1,36 @@
+Prism.languages.scss = Prism.languages.extend('css', {
+ 'comment': {
+ pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,
+ lookbehind: true
+ },
+ // aturle is just the @***, not the entire rule (to highlight var & stuffs)
+ // + add ability to highlight number & unit for media queries
+ 'atrule': /@[\w-]+(?=\s+(\(|\{|;))/gi,
+ // url, compassified
+ 'url': /([-a-z]+-)*url(?=\()/gi,
+ // CSS selector regex is not appropriate for Sass
+ // since there can be lot more things (var, @ directive, nesting..)
+ // a selector must start at the end of a property or after a brace (end of other rules or nesting)
+ // it can contain some caracters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
+ // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
+ // can "pass" as a selector- e.g: proper#{$erty})
+ // this one was ard to do, so please be careful if you edit this one :)
+ 'selector': /([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm
+});
+
+Prism.languages.insertBefore('scss', 'atrule', {
+ 'keyword': /@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i
+});
+
+Prism.languages.insertBefore('scss', 'property', {
+ // var and interpolated vars
+ 'variable': /((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i
+});
+
+Prism.languages.insertBefore('scss', 'ignore', {
+ 'placeholder': /%[-_\w]+/i,
+ 'statement': /\B!(default|optional)\b/gi,
+ 'boolean': /\b(true|false)\b/g,
+ 'null': /\b(null)\b/g,
+ 'operator': /\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g
+});
View
1  media/prism/components/prism-scss.min.js
@@ -0,0 +1 @@
+Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&amp;|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});
View
69 media/prism/plugins/autolinker/index.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+<meta charset="utf-8" />
+<link rel="shortcut icon" href="favicon.png" />
+<title>Autolinker ▲ Prism plugins</title>
+<base href="../.." />
+<link rel="stylesheet" href="style.css" />
+<link rel="stylesheet" href="prism.css" data-noprefix />
+<link rel="stylesheet" href="plugins/autolinker/prism-autolinker.css" data-noprefix />
+<script src="prefixfree.min.js"></script>
+
+<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
+<script src="http://www.google-analytics.com/ga.js" async></script>
+</head>
+<body>
+
+<header>
+ <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
+
+ <h2>Autolinker</h2>
+ <p>Converts URLs and emails in code to clickable links. Parses <a href="http://daringfireball.net/projects/markdown/">Markdown</a> links in comments.</p>
+</header>
+
+<section>
+ <h1>How to use</h1>
+ <p>URLs and emails will be linked automatically, you don’t need to do anything. To link some text inside a comment to a certain URL,
+ you may use the Markdown syntax:
+ <pre><code class="language-markdown">[Text you want to see](http://url-goes-here.com)</code></pre>
+</section>
+
+<section>
+ <h1>Examples</h1>
+
+ <h2>JavaScript</h2>
+ <pre><code class="language-javascript">/**
+ * Prism: Lightweight, robust, elegant syntax highlighting
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
+ * @author Lea Verou http://lea.verou.me
+ * Reach Lea at fake@email.com (no, not really)
+ * And this is [a Markdown link](http://prismjs.com). Sweet, huh?
+ */
+var foo = 5;
+// And a single line comment http://google.com</code></pre>
+
+ <h2>CSS</h2>
+ <pre><code class="language-css">@font-face {
+ src: url(http://lea.verou.me/logo.otf);
+ font-family: 'LeaVerou';
+}</code></pre>
+
+ <h2>HTML</h2>
+ <pre><code class="language-markup">&lt;!-- Links in HTML, woo!
+Lea Verou http://lea.verou.me or, with Markdown, [Lea Verou](http://lea.verou.me) -->
+&lt;img src="http://prismjs.com/img/spectrum.png" alt="In attributes too!" />
+&lt;p>Autolinking in raw text: http://prismjs.com&lt;/p></code></pre>
+</section>
+
+<footer data-src="templates/footer.html" data-type="text/html"></footer>
+
+<script src="prism.js"></script>
+<script src="plugins/autolinker/prism-autolinker.js"></script>
+<script src="utopia.js"></script>
+<script src="code.js"></script>
+
+
+</body>
+</html>
View
3  media/prism/plugins/autolinker/prism-autolinker.css
@@ -0,0 +1,3 @@
+.token a {
+ color: inherit;
+}
View
61 media/prism/plugins/autolinker/prism-autolinker.js
@@ -0,0 +1,61 @@
+(function(){
+
+if (!self.Prism) {
+ return;
+}
+
+var url = /\b([a-z]{3,7}:\/\/|tel:)[\w-+%~/.]+/,
+ email = /\b\S+@[\w.]+[a-z]{2}/,
+ linkMd = /\[([^\]]+)]\(([^)]+)\)/,
+
+ // Tokens that may contain URLs and emails
+ candidates = ['comment', 'url', 'attr-value', 'string'];
+
+for (var language in Prism.languages) {
+ var tokens = Prism.languages[language];
+
+ Prism.languages.DFS(tokens, function (type, def) {
+ if (candidates.indexOf(type) > -1) {
+ if (!def.pattern) {
+ def = this[type] = {
+ pattern: def
+ };
+ }
+
+ def.inside = def.inside || {};
+
+ if (type == 'comment') {
+ def.inside['md-link'] = linkMd;
+ }
+
+ def.inside['url-link'] = url;
+ def.inside['email-link'] = email;
+ }
+ });
+
+ tokens['url-link'] = url;
+ tokens['email-link'] = email;
+}
+
+Prism.hooks.add('wrap', function(env) {
+ if (/-link$/.test(env.type)) {
+ env.tag = 'a';
+
+ var href = env.content;
+
+ if (env.type == 'email-link') {
+ href = 'mailto:' + href;
+ }
+ else if (env.type == 'md-link') {
+ // Markdown
+ var match = env.content.match(linkMd);
+
+ href = match[2];
+ env.content = match[1];
+ }
+
+ env.attributes.href = href;
+ }
+});
+
+})();
View
1  media/prism/plugins/autolinker/prism-autolinker.min.js
@@ -0,0 +1 @@
+(function(){if(!self.Prism)return;var e=/\b([a-z]{3,7}:\/\/|tel:)[\w-+%~/.]+/,t=/\b\S+@[\w.]+[a-z]{2}/,n=/\[([^\]]+)]\(([^)]+)\)/,r=["comment","url","attr-value","string"];for(var i in Prism.languages){var s=Prism.languages[i];Prism.languages.DFS(s,function(i,s){if(r.indexOf(i)>-1){s.pattern||(s=this[i]={pattern:s});s.inside=s.inside||{};i=="comment"&&(s.inside["md-link"]=n);s.inside["url-link"]=e;s.inside["email-link"]=t}});s["url-link"]=e;s["email-link"]=t}Prism.hooks.add("wrap",function(e){if(/-link$/.test(e.type)){e.tag="a";var t=e.content;if(e.type=="email-link")t="mailto:"+t;else if(e.type=="md-link"){var r=e.content.match(n);t=r[2];e.content=r[1]}e.attributes.href=t}})})();
View
67 media/prism/plugins/ie8/index.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+<meta charset="utf-8" />
+<link rel="shortcut icon" href="favicon.png" />
+<title>IE8 ▲ Prism plugins</title>
+<base href="../.." />
+<!--[if lte IE 8]><script>(function(){
+ var a = document.createElement('a'), base = document.getElementsByTagName('base')[0];
+ a.href = base.href;
+ base.href = a.href;
+})()</script><![endif]-->
+<link rel="stylesheet" href="style.css" />
+<link rel="stylesheet" href="prism.css" data-noprefix />
+<link rel="stylesheet" href="plugins/ie8/prism-ie8.css" data-noprefix />
+<script src="prefixfree.min.js"></script>
+
+<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
+<script src="http://www.google-analytics.com/ga.js" async></script>
+</head>
+<body>
+
+<header>
+ <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
+
+ <h2>IE8 (Work in progress)</h2>
+ <p>Adds basic IE8 <a href="">support</a> to Prism through a series of polyfills.</p>
+</header>
+
+<section>
+ <h1>How to use</h1>
+
+</section>
+
+<section>
+ <h1>Examples</h1>
+
+ <h2>JavaScript</h2>
+ <pre><code class="language-javascript">/**
+ * This is a multiline comment
+ */
+var foo = 5; // this is a single line comment
+var str = "A string",
+ r = /and a regex/;</code></pre>
+
+ <h2>CSS</h2>
+ <pre><code class="language-css">@font-face {
+ src: url(http://lea.verou.me/logo.otf);
+ font-family: 'LeaVerou';
+}</code></pre>
+
+ <h2>HTML</h2>
+ <pre><code class="language-markup">&lt;!-- A comment -->
+&lt;img src="http://prismjs.com/img/spectrum.png" alt="" />
+&lt;p>Some text&lt;/p></code></pre>
+</section>
+
+<footer data-src="templates/footer.html" data-type="text/html"></footer>
+
+<script src="prism.js"></script>
+<script src="plugins/ie8/prism-ie8.js"></script>
+<script src="utopia.js"></script>
+<script src="code.js"></script>
+
+</body>
+</html>
View
3  media/prism/plugins/ie8/prism-ie8.css
@@ -0,0 +1,3 @@
+.token a {
+ color: inherit;
+}
View
42 media/prism/plugins/ie8/prism-ie8.js
@@ -0,0 +1,42 @@
+(function(){
+
+if (!window.Prism) {
+ return;
+}
+
+var dummy = document.createElement('header');
+
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^\s+/g, '').replace(/\s+$/g, '');
+ };
+}
+
+// textContent polyfill
+if (!('textContent' in dummy) && ('innerText' in dummy) && Object.defineProperty) {
+ Object.defineProperty(Element.prototype, 'textContent', {
+ get: function() {
+ return this.innerText;
+ },
+ set: function(text) {
+ this.innerText = text;
+ }
+ });
+}
+
+// IE8 doesn't have DOMContentLoaded
+if (!document.addEventListener && 'textContent' in dummy) {
+ setTimeout(Prism.highlightAll, 10);
+}
+
+// Test if innerHTML line break bug is present
+dummy.innerHTML = '\r\n';
+
+if (dummy.textContent.indexOf('\n') === -1) {
+ // IE8 innerHTML bug: Discards line breaks
+ Prism.hooks.add('after-highlight', function(env) {
+ env.element.innerHTML = env.highlightedCode.replace(/\r?\n/g, '<br>');
+ });
+}
+
+})();
View
1  media/prism/plugins/ie8/prism-ie8.min.js
@@ -0,0 +1 @@
+(function(){if(!window.Prism)return;var e=document.createElement("header");String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+/g,"").replace(/\s+$/g,"")});!("textContent"in e)&&"innerText"in e&&Object.defineProperty&&Object.defineProperty(Element.prototype,"textContent",{get:function(){return this.innerText},set:function(e){this.innerText=e}});!document.addEventListener&&"textContent"in e&&setTimeout(Prism.highlightAll,10);e.innerHTML="\r\n";e.textContent.indexOf("\n")===-1&&Prism.hooks.add("after-highlight",function(e){e.element.innerHTML=e.highlightedCode.replace(/\r?\n/g,"<br>")})})();
View
41 media/prism/plugins/index.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+<meta charset="utf-8" />
+<link rel="shortcut icon" href="favicon.png" />
+<title>Plugins ▲ Prism</title>
+<base href=".." />
+<link rel="stylesheet" href="style.css" />
+<link rel="stylesheet" href="prism.css" data-noprefix />
+<link rel="stylesheet" href="plugins/line-highlight/prism-line-highlight.css" data-noprefix />
+<script src="prefixfree.min.js"></script>
+
+<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
+<script src="http://www.google-analytics.com/ga.js" async></script>
+</head>
+<body>
+
+<header>
+ <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
+</header>
+
+<section>
+ <h1>Available plugins</h1>
+ <ul class="plugin-list"></ul>
+</section>
+
+<section>
+ <h1>Contribute</h1>
+ <p>Writing Prism plugins is easy! Read how at the “<a href="extending.html#writing-plugins">Extending Prism</a>” section.
+</section>
+
+<footer data-src="templates/footer.html" data-type="text/html"></footer>
+
+<script src="prism.js"></script>
+<script src="plugins/line-highlight/prism-line-highlight.js"></script>
+<script src="utopia.js"></script>
+<script src="code.js"></script>
+
+</body>
+</html>
View
87 media/prism/plugins/line-highlight/index.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+<meta charset="utf-8" />
+<link rel="shortcut icon" href="favicon.png" />
+<title>Line highlight ▲ Prism plugins</title>
+<base href="../.." />
+<link rel="stylesheet" href="style.css" />
+<link rel="stylesheet" href="prism.css" data-noprefix />
+<link rel="stylesheet" href="plugins/line-highlight/prism-line-highlight.css" data-noprefix />
+<script src="prefixfree.min.js"></script>
+
+<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
+<script src="http://www.google-analytics.com/ga.js" async></script>
+</head>
+<body>
+
+<header>
+ <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
+
+ <h2>Line highlight</h2>
+ <p>Highlights specific lines and/or line ranges.</p>
+</header>
+
+<section class="language-markup">
+ <h1>How to use</h1>
+
+ <p>Obviously, this only works on code blocks (<code>&lt;pre>&lt;code></code>) and not for inline code.
+
+ <p>You specify the lines to be highlighted through the <code>data-line</code> attribute on the <code>&lt;pre></code> element, in the following simple format:</p>
+ <ul>
+ <li>A single number refers to the line with that number</li>
+ <li>Ranges are denoted by two numbers, separated with a hyphen (-)</li>
+ <li>Multiple line numbers or ranges are separated by commas.</li>
+ <li>Whitespace is allowed anywhere and will be stripped off.</li>
+ </ul>
+
+ <p>Examples:</p>
+ <dl>
+ <dt>5</dt>
+ <dd>The 5th line</dd>
+
+ <dt>1-5</dt>
+ <dd>Lines 1 through 5</dd>
+
+ <dt>1,4</dt>
+ <dd>Line 1 and line 4</dd>
+
+ <dt>1-2, 5, 9-20</dt>
+ <dd>Lines 1 through 2, line 5, lines 9 through 20</dd>
+ </dl>
+
+ <p>In case you want the line numbering to be offset by a certain number (for example, you want the 1st line to be number 41 instead of 1, which is an offset of 40), you can additionally use the <code>data-line-offset</code> attribute.
+
+ <p>You can also link to specific lines on any code snippet, by using the following as a url hash: <code>#{element-id}.{lines}</code> where
+ <code>{element-id}</code> is the id of the <code>&lt;pre></code> element and <code>{lines}</code> is one or more lines or line ranges that follow the format
+ outlined above. For example, if there is an element with <code>id="play"</code> on the page, you can link to lines 5-6 by linking to <a href="plugins/line-highlight/#play.5-6">#play.5-6</a></p>
+</section>
+
+<section>
+ <h1>Examples</h1>
+
+ <h2>Line 2</h2>
+ <pre data-line="2" data-src="plugins/line-highlight/prism-line-highlight.js" id="play"></pre>
+
+ <h2>Lines 15-25</h2>
+ <pre data-line="15-25" data-src="plugins/line-highlight/prism-line-highlight.js"></pre>
+
+ <h2>Line 1 and lines 3-4 and line 42</h2>
+ <pre data-line="1,3-4,42" data-src="plugins/line-highlight/prism-line-highlight.js"></pre>
+
+ <h2>Line 43, starting from line 41</h2>
+ <pre data-line="43" data-line-offset="40" data-src="plugins/line-highlight/prism-line-highlight.js"></pre>
+
+ <p><a href="plugins/line-highlight/#play.50-55,60">Linking example</a></p>
+</section>
+
+<footer data-src="templates/footer.html" data-type="text/html"></footer>
+
+<script src="prism.js"></script>
+<script src="plugins/line-highlight/prism-line-highlight.js"></script>
+<script src="utopia.js"></script>
+<script src="code.js"></script>
+
+</body>
+</html>
View
47 media/prism/plugins/line-highlight/prism-line-highlight.css
@@ -0,0 +1,47 @@
+pre[data-line] {
+ position: relative;
+ padding: 1em 0 1em 3em;
+}
+
+.line-highlight {
+ position: absolute;
+ left: 0;
+ right: 0;
+ padding: inherit 0;
+ margin-top: 1em; /* Same as .prism’s padding-top */
+
+ background: hsla(24, 20%, 50%,.08);
+ background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+ background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
+
+ pointer-events: none;
+
+ line-height: inherit;
+ white-space: pre;
+}
+
+ .line-highlight:before,
+ .line-highlight[data-end]:after {
+ content: attr(data-start);
+ position: absolute;
+ top: .4em;
+ left: .6em;
+ min-width: 1em;
+ padding: 0 .5em;
+ background-color: hsla(24, 20%, 50%,.4);
+ color: hsl(24, 20%, 95%);
+ font: bold 65%/1.5 sans-serif;
+ text-align: center;
+ vertical-align: .3em;
+ border-radius: 999px;
+ text-shadow: none;
+ box-shadow: 0 1px white;
+ }
+
+ .line-highlight[data-end]:after {
+ content: attr(data-end);
+ top: auto;
+ bottom: .4em;
+ }
View
94 media/prism/plugins/line-highlight/prism-line-highlight.js
@@ -0,0 +1,94 @@
+(function(){
+
+if(!window.Prism) {
+ return;
+}
+
+function $$(expr, con) {
+ return Array.prototype.slice.call((con || document).querySelectorAll(expr));
+}
+
+var CRLF = crlf = /\r?\n|\r/g;
+
+function highlightLines(pre, lines, classes) {
+ var ranges = lines.replace(/\s+/g, '').split(','),
+ offset = +pre.getAttribute('data-line-offset') || 0;
+
+ var lineHeight = parseFloat(getComputedStyle(pre).lineHeight);
+
+ for (var i=0, range; range = ranges[i++];) {
+ range = range.split('-');
+
+ var start = +range[0],
+ end = +range[1] || start;
+
+ var line = document.createElement('div');
+
+ line.textContent = Array(end - start + 2).join(' \r\n');
+ line.className = (classes || '') + ' line-highlight';
+ line.setAttribute('data-start', start);
+
+ if(end > start) {
+ line.setAttribute('data-end', end);
+ }
+
+ line.style.top = (start - offset - 1) * lineHeight + 'px';
+
+ (pre.querySelector('code') || pre).appendChild(line);
+ }
+}
+
+function applyHash() {
+ var hash = location.hash.slice(1);
+
+ // Remove pre-existing temporary lines
+ $$('.temporary.line-highlight').forEach(function (line) {
+ line.parentNode.removeChild(line);
+ });
+
+ var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1];
+
+ if (!range || document.getElementById(hash)) {
+ return;
+ }
+
+ var id = hash.slice(0, hash.lastIndexOf('.')),
+ pre = document.getElementById(id);
+
+ if (!pre) {
+ return;
+ }
+
+ if (!pre.hasAttribute('data-line')) {
+ pre.setAttribute('data-line', '');
+ }
+
+ highlightLines(pre, range, 'temporary ');
+
+ document.querySelector('.temporary.line-highlight').scrollIntoView();
+}
+
+var fakeTimer = 0; // Hack to limit the number of times applyHash() runs
+
+Prism.hooks.add('after-highlight', function(env) {
+ var pre = env.element.parentNode;
+ var lines = pre && pre.getAttribute('data-line');
+
+ if (!pre || !lines || !/pre/i.test(pre.nodeName)) {
+ return;
+ }
+
+ clearTimeout(fakeTimer);
+
+ $$('.line-highlight', pre).forEach(function (line) {
+ line.parentNode.removeChild(line);
+ });
+
+ highlightLines(pre, lines);
+
+ fakeTimer = setTimeout(applyHash, 1);
+});
+
+addEventListener('hashchange', applyHash);
+
+})();
View
1  media/prism/plugins/line-highlight/prism-line-highlight.min.js
@@ -0,0 +1 @@
+(function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function n(e,t,n){var r=t.replace(/\s+/g,"").split(","),i=+e.getAttribute("data-line-offset")||0,s=parseFloat(getComputedStyle(e).lineHeight);for(var o=0,u;u=r[o++];){u=u.split("-");var a=+u[0],f=+u[1]||a,l=document.createElement("div");l.textContent=Array(f-a+2).join(" \r\n");l.className=(n||"")+" line-highlight";l.setAttribute("data-start",a);f>a&&l.setAttribute("data-end",f);l.style.top=(a-i-1)*s+"px";(e.querySelector("code")||e).appendChild(l)}}function r(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var r=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(!r||document.getElementById(t))return;var i=t.slice(0,t.lastIndexOf(".")),s=document.getElementById(i);if(!s)return;s.hasAttribute("data-line")||s.setAttribute("data-line","");n(s,r,"temporary ");document.querySelector(".temporary.line-highlight").scrollIntoView()}if(!window.Prism)return;var t=crlf=/\r?\n|\r/g,i=0;Prism.hooks.add("after-highlight",function(t){var s=t.element.parentNode,o=s&&s.getAttribute("data-line");if(!s||!o||!/pre/i.test(s.nodeName))return;clearTimeout(i);e(".line-highlight",s).forEach(function(e){e.parentNode.removeChild(e)});n(s,o);i=setTimeout(r,1)});addEventListener("hashchange",r)})();
View
45 media/prism/plugins/show-invisibles/index.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+
+<meta charset="utf-8" />
+<link rel="shortcut icon" href="favicon.png" />
+<title>Show Invisibles ▲ Prism plugins</title>
+<base href="../.." />
+<link rel="stylesheet" href="style.css" />
+<link rel="stylesheet" href="prism.css" data-noprefix />
+<link rel="stylesheet" href="plugins/show-invisibles/prism-show-invisibles.css" data-noprefix />
+<script src="prefixfree.min.js"></script>
+
+<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
+<script src="http://www.google-analytics.com/ga.js" async></script>
+</head>
+<body>
+
+<header>
+ <div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
+
+ <h2>Show Invisibles</h2>
+ <p>Show hidden characters such as tabs and line breaks.</p>
+</header>
+
+<section>
+ <h1>Examples</h1>
+
+ <pre data-src="plugins/show-invisibles/prism-show-invisibles.js"></pre>
+
+ <pre data-src="plugins/show-invisibles/prism-show-invisibles.css"></pre>
+
+ <pre data-src="plugins/show-invisibles/index.html"></pre>
+</section>
+
+<footer data-src="templates/footer.html" data-type="text/html"></footer>
+
+<script src="prism.js"></script>
+<script src="plugins/show-invisibles/prism-show-invisibles.js"></script>
+<script src="utopia.js"></script>
+<script src="code.js"></script>
+
+
+</body>
+</html>
View
17 media/prism/plugins/show-invisibles/prism-show-invisibles.css
@@ -0,0 +1,17 @@
+.token.tab:not(:empty):before,
+.token.cr:before,
+.token.lf:before {
+ color: hsl(24, 20%, 85%);
+}
+
+.token.tab:not(:empty):before {
+ content: '';
+}
+
+.token.cr:before {
+ content: '';
+}
+
+.token.lf:before {
+ content: '';
+}
View
15 media/prism/plugins/show-invisibles/prism-show-invisibles.js
@@ -0,0 +1,15 @@
+(function(){
+
+if(!window.Prism) {
+ return;
+}
+
+for (var language in Prism.languages) {
+ var tokens = Prism.languages[language];
+
+ tokens.tab = /\t/g;
+ tokens.lf = /\n/g;
+ tokens.cr = /\r/g;
+}
+
+})();
View
1  media/prism/plugins/show-invisibles/prism-show-invisibles.min.js
@@ -0,0 +1 @@
+(function(){if(!window.Prism)return;for(var e in Prism.languages){var t=Prism.languages[e];t.tab=/\t/g;t.lf=/\n/g;t.cr=/\r/g}})();
View
111 media/prism/prism-dark.css
@@ -0,0 +1,111 @@
+/**
+ * prism.js Dark theme for JavaScript, CSS and HTML
+ * Based on the slides of the talk “/Reg(exp){2}lained/”
+ * @author Lea Verou
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+ color: white;
+ text-shadow: 0 -.1em .2em black;
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ direction: ltr;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+@media print {
+ code[class*="language-"],
+ pre[class*="language-"] {
+ text-shadow: none;
+ }
+}
+
+pre[class*="language-"],
+:not(pre) > code[class*="language-"] {
+ background: hsl(30,20%,25%);
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: 1em;
+ margin: .5em 0;
+ overflow: auto;
+ border: .3em solid hsl(30,20%,40%);
+ border-radius: .5em;
+ box-shadow: 1px 1px .5em black inset;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: .15em .2em .05em;
+ border-radius: .3em;
+ border: .13em solid hsl(30,20%,40%);
+ box-shadow: 1px 1px .3em -.1em black inset;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: hsl(30,20%,50%);
+}
+
+.token.punctuation {
+ opacity: .7;
+}
+
+.namespace {
+ opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number {
+ color: hsl(350, 40%, 70%);
+}
+
+.token.selector,
+.token.attr-name,
+.token.string {
+ color: hsl(75, 70%, 60%);
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+ color: hsl(40, 90%, 60%);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+ color: hsl(350, 40%, 70%);
+}
+
+
+.token.regex,
+.token.important {
+ color: #e90;
+}
+
+.token.important {
+ font-weight: bold;
+}
+
+.token.entity {
+ cursor: help;
+}
View
100 media/prism/prism-funky.css
@@ -0,0 +1,100 @@
+/**
+ * prism.js Funky theme
+ * Based on “Polyfilling the gaps” talk slides http://lea.verou.me/polyfilling-the-gaps/
+ * @author Lea Verou
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ direction: ltr;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: .4em .8em;
+ margin: .5em 0;
+ overflow: auto;
+ background: url('data:image/svg+xml;charset=utf-8,<svg%20version%3D"1.1"%20xmlns%3D"http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg"%20width%3D"100"%20height%3D"100"%20fill%3D"rgba(0%2C0%2C0%2C.2)">%0D%0A<polygon%20points%3D"0%2C50%2050%2C0%200%2C0"%20%2F>%0D%0A<polygon%20points%3D"0%2C100%2050%2C100%20100%2C50%20100%2C0"%20%2F>%0D%0A<%2Fsvg>');
+ background-size: 1em 1em;
+}
+
+code[class*="language-"] {
+ background: black;
+ color: white;
+ box-shadow: -.3em 0 0 .3em black, .3em 0 0 .3em black;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: .2em;
+ border-radius: .3em;
+ box-shadow: none;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: #aaa;
+}
+
+.token.punctuation {
+ color: #999;
+}
+
+.namespace {
+ opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number {
+ color: #0cf;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string {
+ color: yellow;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string {
+ color: yellowgreen;
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+ color: deeppink;
+}
+
+
+.token.regex,
+.token.important {
+ color: orange;
+}
+
+.token.important {
+ font-weight: bold;
+}
+
+.token.entity {
+ cursor: help;
+}
View
107 media/prism/prism.css
@@ -0,0 +1,107 @@
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+ color: black;
+ text-shadow: 0 1px white;
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
+ direction: ltr;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+@media print {
+ code[class*="language-"],
+ pre[class*="language-"] {
+ text-shadow: none;
+ }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: 1em;
+ margin: .5em 0;
+ overflow: auto;
+}
+
+:not(pre) > code[class*="language-"],
+pre[class*="language-"] {
+ background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: .1em;
+ border-radius: .3em;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: slategray;
+}
+
+.token.punctuation {
+ color: #999;
+}
+
+.namespace {
+ opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number {
+ color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string {
+ color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+ color: #a67f59;
+ background: hsla(0,0%,100%,.5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+ color: #07a;
+}
+
+
+.token.regex,
+.token.important {
+ color: #e90;
+}
+
+.token.important {
+ font-weight: bold;