[Pkg-javascript-commits] [highlight.js] 01/07: Imported Upstream version 7.4+ds

Cédric Boutillier boutil at alioth.debian.org
Thu Nov 7 10:07:26 UTC 2013


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository highlight.js.

commit 160bf861cd61d5d4e58c00e67c22a4a76f942275
Author: Cédric Boutillier <boutil at debian.org>
Date:   Thu Nov 7 08:49:56 2013 +0100

    Imported Upstream version 7.4+ds
---
 .gitignore                                      |    1 +
 AUTHORS.en.txt                                  |   17 +-
 AUTHORS.ru.txt                                  |   19 +-
 README.md                                       |   33 +-
 README.ru.md                                    |   32 +-
 classref.txt                                    |  110 +++-
 docs/api.rst                                    |    7 +-
 docs/building-testing.rst                       |   48 +-
 docs/conf.py                                    |    4 +-
 docs/contribution.rst                           |    6 +-
 docs/language-guide.rst                         |    2 +-
 docs/reference.rst                              |    2 +-
 src/export.html                                 |    2 +-
 src/highlight.js                                |   58 +-
 src/languages/applescript.js                    |    3 +-
 src/languages/asciidoc.js                       |  187 +++++++
 src/languages/axapta.js                         |    6 +-
 src/languages/bash.js                           |   62 ++-
 src/languages/clojure.js                        |    5 +-
 src/languages/coffeescript.js                   |  121 +++--
 src/languages/cpp.js                            |    6 +-
 src/languages/cs.js                             |    2 +-
 src/languages/css.js                            |   27 +-
 src/languages/django.js                         |    5 +-
 src/languages/fsharp.js                         |   56 ++
 src/languages/haml.js                           |  142 +++++
 src/languages/handlebars.js                     |   64 +++
 src/languages/haskell.js                        |    4 +-
 src/languages/ini.js                            |    3 +-
 src/languages/java.js                           |    3 +-
 src/languages/javascript.js                     |   19 +-
 src/languages/lasso.js                          |  112 ++++
 src/languages/lisp.js                           |   11 +-
 src/languages/mizar.js                          |   24 +
 src/languages/nginx.js                          |    3 +-
 src/languages/objectivec.js                     |   11 +-
 src/languages/parser3.js                        |    2 +-
 src/languages/profile.js                        |    2 +-
 src/languages/python.js                         |   26 +-
 src/languages/ruleslanguage.js                  |   62 +++
 src/languages/rust.js                           |   11 +-
 src/languages/scss.js                           |  114 ++++
 src/languages/smalltalk.js                      |    5 +-
 src/languages/sql.js                            |    4 +-
 src/languages/vala.js                           |    5 +-
 src/languages/vbnet.js                          |   54 ++
 src/languages/xml.js                            |    4 +-
 src/package.json                                |    4 +-
 src/styles/arta.css                             |    3 +-
 src/styles/dark.css                             |    3 +-
 src/styles/default.css                          |   18 +-
 src/styles/{github.css => docco.css}            |   52 +-
 src/styles/far.css                              |    3 +-
 src/styles/foundation.css                       |  113 ++++
 src/styles/github.css                           |    4 +-
 src/styles/googlecode.css                       |    3 +-
 src/styles/ir_black.css                         |    3 +-
 src/styles/magula.css                           |    3 +-
 src/styles/mono-blue.css                        |   59 +++
 src/styles/monokai.css                          |   12 +-
 src/styles/{monokai.css => monokai_sublime.css} |  215 ++++----
 src/styles/{monokai.css => obsidian.css}        |   89 +++-
 src/styles/{sunburst.css => railscasts.css}     |  111 ++--
 src/styles/school_book.css                      |    3 +-
 src/styles/solarized_dark.css                   |    7 +-
 src/styles/solarized_light.css                  |    7 +-
 src/styles/sunburst.css                         |    3 +-
 src/styles/tomorrow-night-blue.css              |    2 +-
 src/styles/tomorrow-night-bright.css            |    2 +-
 src/styles/tomorrow-night-eighties.css          |    2 +-
 src/styles/tomorrow-night.css                   |    2 +-
 src/styles/tomorrow.css                         |    2 +-
 src/styles/vs.css                               |    4 +-
 src/styles/xcode.css                            |    4 +-
 src/styles/zenburn.css                          |    3 +-
 src/test.html                                   |  646 ++++++++++++++++++++---
 tools/build.py                                  |  125 +++--
 tools/build3.py                                 |  305 -----------
 78 files changed, 2423 insertions(+), 895 deletions(-)

diff --git a/.gitignore b/.gitignore
index 802f776..865b546 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 .DS_Store
 build
 docs/_build
+__pycache__
diff --git a/AUTHORS.en.txt b/AUTHORS.en.txt
index d224f1d..e593c21 100644
--- a/AUTHORS.en.txt
+++ b/AUTHORS.en.txt
@@ -1,6 +1,6 @@
 Syntax highlighting with language autodetection.
 
-URL:   http://softwaremaniacs.org/soft/highlight/en/
+URL:   http://highlightjs.org/
 
 Original author and current maintainer:
 Ivan Sagalaev <maniac at softwaremaniacs.org>
@@ -67,3 +67,18 @@ Contributors:
 - Kirk Kimmel <kimmel.k.programmer at gmail.com>
 - Nathan Grigg <nathan at nathanamy.org>
 - Dr. Drang <drdrang at gmail.com>
+- Robin Ward <robin.ward at gmail.com>
+- Dmitry Medvinsky <me at dmedvinsky.name>
+- Jason Jacobson <jason.a.jacobson at gmail.com>
+- Jonas Follesø <jonas at follesoe.no>
+- Dan Allen <dan.j.allen at gmail.com>
+- noformnocontent <i at noformnocontent.com>
+- Damien White <damien.white at visoftinc.com>
+- Alexander Marenin <great_muchacho at mail.ru>
+- Cédric Néhémie <cedric.nehemie at gmail.com>
+- Simon Madine <simon at angryrobotzombie.com>
+- Benjamin Pannell <contact at sierrasoftworks.com>
+- Eric Knibbe <eric at lassosoft.com>
+- Poren Chiang <ren.chiang at gmail.com>
+- Kelley van Evert <kelleyvanevert at gmail.com>
+- Kurt Emch <kurt at kurtemch.com>
diff --git a/AUTHORS.ru.txt b/AUTHORS.ru.txt
index df1415d..0b28b82 100644
--- a/AUTHORS.ru.txt
+++ b/AUTHORS.ru.txt
@@ -1,6 +1,6 @@
 Подсветка синтаксиса с автоопределением языка.
 
-URL:   http://softwaremaniacs.org/soft/highlight/
+URL:   http://highlightjs.org/
 
 Первоначальный автор и ведущий проекта:
 Иван Сагалаев <maniac at softwaremaniacs.org>
@@ -64,6 +64,21 @@ URL:   http://softwaremaniacs.org/soft/highlight/
 - Кейси Данкан <casey.duncan at gmail.com>
 - Евгений Нижибицкий <nizhibitsky at gmail.com>
 - Альберто Гимено <gimenete at gmail.com>
-- Кирк Киммельы <kimmel.k.programmer at gmail.com>
+- Кирк Киммель <kimmel.k.programmer at gmail.com>
 - Натан Григг <nathan at nathanamy.org>
 - Dr. Drang <drdrang at gmail.com>
+- Робин Ворд <robin.ward at gmail.com>
+- Дмитрий Медвинский <me at dmedvinsky.name>
+- Джейсон Джейкобсон <jason.a.jacobson at gmail.com>
+- Йонас Фоллесо <jonas at follesoe.no>
+- Ден Аллен <dan.j.allen at gmail.com>
+- noformnocontent <i at noformnocontent.com>
+- Дамиен Вайт <damien.white at visoftinc.com>
+- Александр Маренин <great_muchacho at mail.ru>
+- Седрик Нееми <cedric.nehemie at gmail.com>
+- Саймон Мадин <simon at angryrobotzombie.com>
+- Бенджамин Паннел <contact at sierrasoftworks.com>
+- Эрик Книббе <eric at lassosoft.com>
+- Порен Чянь <ren.chiang at gmail.com>
+- Келли ван Эверт <kelleyvanevert at gmail.com>
+- Курт Эмч <kurt at kurtemch.com>
diff --git a/README.md b/README.md
index 3f0b749..c25a0a5 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ If you use different markup or need to apply highlighting dynamically, read
 
 - You can download your own customized version of "highlight.pack.js" or
   use the hosted one as described on the download page:
-  <http://softwaremaniacs.org/soft/highlight/en/download/>
+  <http://highlightjs.org/download/>
 
 - Style themes are available in the download package or as hosted files.
   To create a custom style for your site see the class reference in the file
@@ -42,7 +42,7 @@ installable from NPM:
 
 Alternatively, you can build it from the source with only languages you need:
 
-    python tools/build.py -tnode lang1 lang2 ..
+    python3 tools/build.py -tnode lang1 lang2 ..
 
 Using the library:
 
@@ -56,6 +56,31 @@ hljs.highlight(lang, code).value;
 hljs.highlightAuto(code).value;
 ```
 
+
+## AMD
+
+Highlight.js can be used with an AMD loader.  You will need to build it from
+source in order to do so:
+
+```bash
+$ python3 tools/build.py -tamd lang1 lang2 ..
+```
+
+Which will generate a `build/highlight.pack.js` which will load as an AMD
+module with support for the built languages and can be used like so:
+
+```javascript
+require(["highlight.js/build/highlight.pack"], function(hljs){
+
+  // If you know the language
+  hljs.highlight(lang, code).value;
+
+  // Automatic language detection
+  hljs.highlightAuto(code).value;
+});
+```
+
+
 ## Tab replacement
 
 You can replace TAB ('\x09') characters used for indentation in your code
@@ -135,8 +160,8 @@ on a site.
 
 ## Meta
 
-- Version: 7.3
-- URL:     http://softwaremaniacs.org/soft/highlight/en/
+- Version: 7.4
+- URL:     http://highlightjs.org/
 - Author:  Ivan Sagalaev (<maniac at softwaremaniacs.org>)
 
 For the license terms see LICENSE files.
diff --git a/README.ru.md b/README.ru.md
index 65e419f..96dd86c 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -26,7 +26,7 @@ Highlight.js нужен для подсветки синтаксиса в при
 
 - Вы можете скачать собственную версию "highlight.pack.js" или сослаться
   на захостенный файл, как описано на странице загрузки:
-  <http://softwaremaniacs.org/soft/highlight/download/>
+  <http://highlightjs.org/download/>
 
 - Стилевые темы можно найти в загруженном архиве или также использовать
   захостенные. Чтобы сделать собственный стиль для своего сайта, вам
@@ -45,7 +45,7 @@ Highlight.js можно использовать в node.js. Библиотек
 
 Также её можно собрать из исходников с только теми языками, которые нужны:
 
-    python tools/build.py -tnode lang1 lang2 ..
+    python3 tools/build.py -tnode lang1 lang2 ..
 
 Использование библиотеки:
 
@@ -60,6 +60,30 @@ hljs.highlightAuto(code).value;
 ```
 
 
+## AMD
+
+Highlight.js можно использовать с загрузчиком AMD-модулей.  Для этого его
+нужно собрать из исходников следующей командой:
+
+```bash
+$ python3 tools/build.py -tamd lang1 lang2 ..
+```
+
+Она создаст файл `build/highlight.pack.js`, который является загружаемым
+AMD-модулем и содержит все выбранные при сборке языки. Используется он так:
+
+```javascript
+require(["highlight.js/build/highlight.pack"], function(hljs){
+
+  // Если вы знаете язык
+  hljs.highlight(lang, code).value;
+
+  // Автоопределение языка
+  hljs.highlightAuto(code).value;
+});
+```
+
+
 ## Замена TABов
 
 Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на
@@ -141,8 +165,8 @@ highlight.js.
 
 ## Координаты
 
-- Версия: 7.3
-- URL:    http://softwaremaniacs.org/soft/highlight/
+- Версия: 7.4
+- URL:    http://highlightjs.org/
 - Автор:  Иван Сагалаев (<maniac at softwaremaniacs.org>)
 
 Лицензионное соглашение читайте в файле LICENSE.
diff --git a/classref.txt b/classref.txt
index b22bdad..262b612 100644
--- a/classref.txt
+++ b/classref.txt
@@ -19,7 +19,7 @@ Python profiler results ("profile"):
 
   number           number
   string           string
-  builtin          builtin function entry
+  built_in         built-in function entry
   filename         filename in an entry
   summary          profiling summary
   header           header of table of results
@@ -41,6 +41,18 @@ Ruby ("ruby"):
   parent           name of a parent class
   symbol           symbol
 
+Haml ("haml"):
+
+  tag              any tag starting with "%"
+  title            tag's name
+  attribute        tag's attribute
+  keyword          tag's attribute that is a keyword
+  string           attribute's value that is a string
+  value            attribute's value, shorthand id or class for tag
+  comment          comment
+  doctype          !!! declaration
+  bullet           line defined by variable
+
 Perl ("perl"):
 
   keyword          keyword
@@ -96,6 +108,23 @@ HTML, XML ("xml"):
   doctype          <!DOCTYPE ... > declaration
   cdata            CDATA section
 
+Lasso ("lasso"):
+
+  preprocessor     delimiters and interpreter flags
+  shebang          Lasso 9 shell script header
+  comment          single- or multi-line comment
+  javadoc          doc comment
+  keyword          keyword
+  literal          keyword representing a value
+  built_in         built-in types and variables
+  number           number
+  string           string
+  variable         variable reference starting with "#" or "$"
+  tag              tag literal
+  attribute        named or rest parameter in method signature
+  class            type, trait, or method header
+  title            name following "define" inside a header
+
 CSS ("css"):
 
   tag              tag in selectors
@@ -115,6 +144,27 @@ CSS ("css"):
   function         CSS function within a value
   important        "!important" symbol
 
+SCSS ("scss")
+
+  tag              tag in selectors
+  id               #some_name in selectors
+  class            .some_name in selectors
+  at_rule          @-rule till first "{" or ";"
+  attr_selector    attribute selector (square brackets in a[href^=http://])
+  pseudo           pseudo classes and elemens (:after, ::after etc.)
+  comment          comment
+  rules            everything from "{" till "}"
+  attribute        property name inside a rule
+  value            property value inside a rule, from ":" till ";" or
+                   till the end of rule block
+  number           number within a value
+  string           string within a value
+  hexcolor         hex color (#FFFFFF) within a value
+  function         CSS function within a value
+  important        "!important" symbol
+  variable         variable starting with "$"
+  preprocessor     keywords after @
+
 Markdown ("markdown"):
 
   header            header
@@ -127,6 +177,21 @@ Markdown ("markdown"):
   link_label        link label
   link_url          link url
 
+AsciiDoc ("asciidoc"):
+
+  header            heading
+  bullet            list or labeled bullet
+  emphasis          emphasis
+  strong            strong emphasis
+  blockquote        blockquote
+  code              inline or block code
+  horizontal_rule   horizontal rule
+  link_label        link or image label
+  link_url          link or image url
+  comment           comment
+  attribute         document attribute, block attributes
+  label             admonition label
+
 Django ("django"):
 
   keyword          HTML tag in HTML, default tags and default filters in templates
@@ -141,6 +206,14 @@ Django ("django"):
   filter           filter from "|" till the next filter or the end of tag
   argument         filter argument
 
+Handlebars ("handlebars"):
+
+  expression       expression to be evaluated
+  variable         variable
+  begin-block      the beginning of a block
+  end-block        the ending of a block
+  string           string
+
 JSON ("json"):
 
   number           number
@@ -167,7 +240,9 @@ CoffeeScript ("coffeescript"):
   comment          comment
   number           number
   literal          special literal: "true", "false" and "null"
+  built_in         built-in objects and functions ("window", "console", "require", etc...)
   string           string
+  subst            #{ ... } interpolation in double-quoted strings
   regexp           regular expression
   function         header of a function
   class            header of a class
@@ -200,6 +275,16 @@ VBScript ("vbscript"):
   comment          comment
   built_in         built-in function
 
+VB.Net ("vbnet"):
+
+  keyword          keyword
+  built_in         built-in types
+  literal          "true", "false" and "nothing"
+  string           string
+  comment          comment
+  xmlDocTag        xmldoc tag ("'''", "<!--", "-->", "<..>")
+  preprocessor     preprocessor directive
+
 HTTP ("http"):
 
   request          first line of a request
@@ -282,6 +367,15 @@ C# ("cs"):
   comment          commment
   xmlDocTag        xmldoc tag ("///", "<!--", "-->", "<..>")
 
+F# ("fsharp"):
+  keywords         keyword
+  number           number
+  string           string
+  commment         comment
+  class            any custom F# type
+  title            the name of a custom F# type
+  annotation       any attribute
+
 D language ("d"):
 
   comment          comment
@@ -435,6 +529,15 @@ Axapta ("axapta"):
   inheritance      keywords "extends" and "implements" inside class header
   preprocessor     preprocessor directive
 
+Oracle Rules Language ("ruleslanguage"):
+
+  comment          comment
+  string           string constant
+  number           number
+  keyword          language keywords
+  built_in         built-in functions
+  array            array stem
+
 1C ("1c"):
 
   keyword          keyword
@@ -566,3 +669,8 @@ Brainfuck ("brainfuck"):
   literal          Brainfuck inc and dec commands
   comment          comment
   string           Brainfuck input and output commands
+
+Mizar ("mizar"):
+
+  keyword          keyword
+  comment          comment
diff --git a/docs/api.rst b/docs/api.rst
index f013af9..1c41d5b 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -4,11 +4,14 @@ Library API
 Highilght.js exports a few functions as methods of the ``hljs`` object.
 
 
-``highlight(language_name, value)``
+``highlight(language_name, value, ignore_illegals)``
 -----------------------------------
 
 Core highlighting function.
-Accepts a language name and a string with the code to highlight.
+Accepts a language name and a string with the code to highlight. The third
+parameter ``ignore_illegals``, when present and evaluates to a true value, forces
+highlighting to finish even in case of detecting illegal syntax for the language
+instead of throwing an exception.
 Returns an object with the following properties:
 
 * ``language``: language name, same as the one passed into a function, returned for consistency with ``highlightAuto``
diff --git a/docs/building-testing.rst b/docs/building-testing.rst
index 9d027f6..94ad7a5 100644
--- a/docs/building-testing.rst
+++ b/docs/building-testing.rst
@@ -1,35 +1,30 @@
 Building and testing
 ====================
 
-To actually run highlight.js it is necessary to build it for the environment where you're going to run it: a browser, the node.js server, etc.
+To actually run highlight.js it is necessary to build it for the environment
+where you're going to run it: a browser, the node.js server, etc.
 
 
 Building
 --------
 
-The build tool is written in Python (for both 2.x and 3.x variants).
-It also can use YUICompressor for the in-browser builds so make sure you have Java installed for that too.
+The build tool is written in Python, 3.x version. It also can use
+YUICompressor for the in-browser builds so make sure you have Java installed
+for that too.
 
-The tool is located in ``tools/build.py`` (``tools/build3.py`` for Python 3).
-A few useful examples:
+The tool is located in ``tools/build.py``. A few useful examples:
 
-* Build for a browser using only common languages (they will be listed as it works):
+* Build for a browser using only common languages::
 
-::
+    python3 tools/build.py :common
 
-  python tools/build.py :common
+* Build for node.js including all available languages::
 
-* Build for node.js including all available languages:
+    python3 tools/build.py -t node
 
-::
+* Build two specific languages for debugging, skipping compression in this case::
 
-  python tools/build.py -t node
-
-* Build two specific languages for debugging, skipping compression in this case:
-
-::
-
-  python tools/build.py -n python ruby
+    python3 tools/build.py -n python ruby
 
 The full option reference is available with the usual ``--help`` option.
 
@@ -39,11 +34,14 @@ The build result will be in the ``build/`` directory.
 Testing
 -------
 
-Testing is done in a browser using the provided ``src/test.html`` file that contains snippets for all the supported languages.
-You can use browser builds with all or only some of the languages, with or without compression.
-
-The usual approach to debugging and testing a language is first building highlight.js
-with only the language you're working on without compression (to have readable code in browser error messages).
-After this you have to build the entire package with all the languages and see if anything is broken.
-If your language breaks auto-detection it should be fixed by :ref:`improving relevance <relevance>` and is a black art in and of itself.
-When in doubt, please refer to the discussion group!
+Testing is done in a browser using the provided ``src/test.html`` file that
+contains snippets for all the supported languages. You can use browser builds
+with all or only some of the languages, with or without compression.
+
+The usual approach to debugging and testing a language is first building
+highlight.js with only the language you're working on without compression
+(to have readable code in browser error messages). After this you have to build
+the entire package with all the languages and see if anything is broken. If your
+language breaks auto-detection it should be fixed by
+:ref:`improving relevance <relevance>` and is a black art in and of itself. When
+in doubt, please refer to the discussion group!
diff --git a/docs/conf.py b/docs/conf.py
index c537740..3ce5c96 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -48,9 +48,9 @@ copyright = u'2012, Ivan Sagalaev'
 # built documents.
 #
 # The short X.Y version.
-version = '7.2'
+version = '7.4'
 # The full version, including alpha/beta/rc tags.
-release = '7.2'
+release = '7.4'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/docs/contribution.rst b/docs/contribution.rst
index c790328..44fb336 100644
--- a/docs/contribution.rst
+++ b/docs/contribution.rst
@@ -18,7 +18,7 @@ this is done during the build process and details differ for different build tar
     }
   }
   
-The name of the file is used as a a short language identifier and should be usable as a class name in HTML and CSS.
+The name of the file is used as a short language identifier and should be usable as a class name in HTML and CSS.
   
 
 2. Provide meta data
@@ -42,9 +42,9 @@ Meta data format is simply key-value pairs each occupying its own line:
 ``Requires`` — a list of other language files required for this language to work.
 This make it possible to describe languages that extend definitions of other ones.
 Required files aren't processed in any special way.
-The build system just make sure that they will be in the final package in ``LANGUAGES`` object.
+The build system just makes sure that they will be in the final package in ``LANGUAGES`` object.
 
-Meaning of other headers is pretty obvious.
+The meaning of the other headers is pretty obvious.
 
 
 3. Create a test fragment
diff --git a/docs/language-guide.rst b/docs/language-guide.rst
index 1bfb2ba..bb12eb1 100644
--- a/docs/language-guide.rst
+++ b/docs/language-guide.rst
@@ -87,7 +87,7 @@ The group name becomes then a class name in a generated markup enabling differen
 
 To detect keywords highlight.js breaks the processed chunk of code into separate words — a process called lexing.
 The "word" here is defined by the regexp ``[a-zA-Z][a-zA-Z0-9_]*`` that works for keywords in most languages.
-Different lexing rules can be defines by the ``lexems`` attribute:
+Different lexing rules can be defined by the ``lexems`` attribute:
 
 ::
 
diff --git a/docs/reference.rst b/docs/reference.rst
index fa2ee82..c945e01 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -81,7 +81,7 @@ Used instead of ``begin`` for modes starting with keywords to avoid needless rep
 ::
 
   {
-    beginWithKeywords: true, keywords: 'extends implements'
+    beginWithKeyword: true, keywords: 'extends implements'
   }
 
 
diff --git a/src/export.html b/src/export.html
index 5a26425..a61babd 100644
--- a/src/export.html
+++ b/src/export.html
@@ -81,7 +81,7 @@ Copyright (c) Vladimir Gubarkov <xonixx at gmail.com>
         <div id="highlight-view"></div>
         <address>
           Export script: <a href="mailto:xonixx at gmail.com">Vladimir Gubarkov</a><br>
-          Highlighting: <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>
+          Highlighting: <a href="http://highlightjs.org/">highlight.js</a>
         </address>
     </body>
 </html>
diff --git a/src/highlight.js b/src/highlight.js
index 071229d..0438cf9 100644
--- a/src/highlight.js
+++ b/src/highlight.js
@@ -1,6 +1,6 @@
 /*
 Syntax highlighting with language autodetection.
-http://softwaremaniacs.org/soft/highlight/
+http://highlightjs.org/
 */
 
 function() {
@@ -33,7 +33,7 @@ function() {
   }
 
   function blockLanguage(block) {
-    var classes = (block.className + ' ' + block.parentNode.className).split(/\s+/);
+    var classes = (block.className + ' ' + (block.parentNode ? block.parentNode.className : '')).split(/\s+/);
     classes = classes.map(function(c) {return c.replace(/^language-/, '')});
     for (var i = 0; i < classes.length; i++) {
       if (languages[classes[i]] || classes[i] == 'no-highlight') {
@@ -136,9 +136,13 @@ function() {
 
   function compileLanguage(language) {
 
+    function reStr(re) {
+        return (re && re.source) || re;
+    }
+
     function langRe(value, global) {
       return RegExp(
-        value,
+        reStr(value),
         'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '')
       );
     }
@@ -160,7 +164,7 @@ function() {
           });
         }
 
-        mode.lexemsRe = langRe(mode.lexems || hljs.IDENT_RE, true);
+        mode.lexemsRe = langRe(mode.lexems || hljs.IDENT_RE + '(?!\\.)', true);
         if (typeof mode.keywords == 'string') { // string
           flatten('keyword', mode.keywords)
         } else {
@@ -174,14 +178,14 @@ function() {
       }
       if (parent) {
         if (mode.beginWithKeyword) {
-          mode.begin = '\\b(' + keywords.join('|') + ')\\s';
+          mode.begin = '\\b(' + keywords.join('|') + ')\\b(?!\\.)\\s*';
         }
         mode.beginRe = langRe(mode.begin ? mode.begin : '\\B|\\b');
         if (!mode.end && !mode.endsWithParent)
           mode.end = '\\B|\\b';
         if (mode.end)
           mode.endRe = langRe(mode.end);
-        mode.terminator_end = mode.end || '';
+        mode.terminator_end = reStr(mode.end) || '';
         if (mode.endsWithParent && parent.terminator_end)
           mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end;
       }
@@ -204,13 +208,13 @@ function() {
 
       var terminators = [];
       for (var i = 0; i < mode.contains.length; i++) {
-        terminators.push(mode.contains[i].begin);
+        terminators.push(reStr(mode.contains[i].begin));
       }
       if (mode.terminator_end) {
-        terminators.push(mode.terminator_end);
+        terminators.push(reStr(mode.terminator_end));
       }
       if (mode.illegal) {
-        terminators.push(mode.illegal);
+        terminators.push(reStr(mode.illegal));
       }
       mode.terminators = terminators.length ? langRe(terminators.join('|'), true) : {exec: function(s) {return null;}};
     }
@@ -227,7 +231,7 @@ function() {
   - value (an HTML string with highlighting markup)
 
   */
-  function highlight(language_name, value) {
+  function highlight(language_name, value, ignore_illegals) {
 
     function subMode(lexem, mode) {
       for (var i = 0; i < mode.contains.length; i++) {
@@ -248,7 +252,7 @@ function() {
     }
 
     function isIllegal(lexem, mode) {
-      return mode.illegal && mode.illegalRe.test(lexem);
+      return !ignore_illegals && mode.illegal && mode.illegalRe.test(lexem);
     }
 
     function keywordMatch(mode, match) {
@@ -312,7 +316,6 @@ function() {
         mode_buffer = lexem;
       }
       top = Object.create(mode, {parent: {value: top}});
-      relevance += mode.relevance;
     }
 
     function processLexem(buffer, lexem) {
@@ -331,7 +334,8 @@ function() {
 
       var end_mode = endOfMode(top, lexem);
       if (end_mode) {
-        if (!(end_mode.returnEnd || end_mode.excludeEnd)) {
+        var origin = top;
+        if (!(origin.returnEnd || origin.excludeEnd)) {
           mode_buffer += lexem;
         }
         result += processBuffer();
@@ -339,20 +343,21 @@ function() {
           if (top.className) {
             result += '</span>';
           }
+          relevance += top.relevance;
           top = top.parent;
         } while (top != end_mode.parent);
-        if (end_mode.excludeEnd) {
+        if (origin.excludeEnd) {
           result += escape(lexem);
         }
         mode_buffer = '';
         if (end_mode.starts) {
           startNewMode(end_mode.starts, '');
         }
-        return end_mode.returnEnd ? 0 : lexem.length;
+        return origin.returnEnd ? 0 : lexem.length;
       }
 
       if (isIllegal(lexem, top))
-        throw 'Illegal';
+        throw new Error('Illegal lexem "' + lexem + '" for mode "' + (top.className || '<unnamed>') + '"');
 
       /*
       Parser should not reach this point as all types of lexems should be caught
@@ -388,7 +393,7 @@ function() {
         language: language_name
       };
     } catch (e) {
-      if (e == 'Illegal') {
+      if (e.message.indexOf('Illegal') != -1) {
         return {
           relevance: 0,
           keyword_count: 0,
@@ -422,7 +427,7 @@ function() {
     for (var key in languages) {
       if (!languages.hasOwnProperty(key))
         continue;
-      var current = highlight(key, text);
+      var current = highlight(key, text, false);
       current.language = key;
       if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {
         second_best = current;
@@ -466,7 +471,7 @@ function() {
     var language = blockLanguage(block);
     if (language == 'no-highlight')
         return;
-    var result = language ? highlight(language, text) : highlightAuto(text);
+    var result = language ? highlight(language, text, true) : highlightAuto(text);
     language = result.language;
     var original = nodeStream(block);
     if (original.length) {
@@ -534,7 +539,7 @@ function() {
   this.NUMBER_RE = '\\b\\d+(\\.\\d+)?';
   this.C_NUMBER_RE = '(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float
   this.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b...
-  this.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
+  this.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~';
 
   // Common modes
   this.BACKSLASH_ESCAPE = {
@@ -581,6 +586,19 @@ function() {
     begin: this.BINARY_NUMBER_RE,
     relevance: 0
   };
+  this.REGEXP_MODE = {
+    className: 'regexp',
+    begin: /\//, end: /\/[gim]*/,
+    illegal: /\n/,
+    contains: [
+      this.BACKSLASH_ESCAPE,
+      {
+        begin: /\[/, end: /\]/,
+        relevance: 0,
+        contains: [this.BACKSLASH_ESCAPE]
+      }
+    ]
+  }
 
   // Utility functions
   this.inherit = function(parent, obj) {
diff --git a/src/languages/applescript.js b/src/languages/applescript.js
index 6eb9b3e..b8240df 100644
--- a/src/languages/applescript.js
+++ b/src/languages/applescript.js
@@ -98,6 +98,7 @@ function(hljs) {
         illegal: '[${=;\\n]',
         contains: [TITLE, PARAMS]
       }
-    ].concat(COMMENTS)
+    ].concat(COMMENTS),
+    illegal: '//'
   };
 }
diff --git a/src/languages/asciidoc.js b/src/languages/asciidoc.js
new file mode 100644
index 0000000..f0538ce
--- /dev/null
+++ b/src/languages/asciidoc.js
@@ -0,0 +1,187 @@
+/*
+Language: AsciiDoc
+Requires: xml.js
+Author: Dan Allen <dan.j.allen at gmail.com>
+Website: http://google.com/profiles/dan.j.allen
+Description: A semantic, text-based document format that can be exported to HTML, DocBook and other backends.
+*/
+function(hljs) {
+  return {
+    contains: [
+      // block comment
+      {
+        className: 'comment',
+        begin: '^/{4,}\\n',
+        end: '\\n/{4,}$',
+        // can also be done as...
+        //begin: '^/{4,}$',
+        //end: '^/{4,}$',
+        relevance: 10
+      },
+      // line comment
+      {
+        className: 'comment',
+        begin: '^//',
+        end: '$',
+        relevance: 0
+      },
+      // title
+      {
+        className: 'title',
+        begin: '^\\.\\w.*$'
+      },
+      // example, admonition & sidebar blocks
+      {
+        begin: '^[=\\*]{4,}\\n',
+        end: '\\n^[=\\*]{4,}$',
+        relevance: 10
+      },
+      // headings
+      {
+        className: 'header',
+        begin: '^(={1,5}) .+?( \\1)?$',
+        relevance: 10
+      },
+      {
+        className: 'header',
+        begin: '^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$',
+        relevance: 10
+      },
+      // document attributes
+      {
+        className: 'attribute',
+        begin: '^:.+?:',
+        end: '\\s',
+        excludeEnd: true,
+        relevance: 10
+      },
+      // block attributes
+      {
+        className: 'attribute',
+        begin: '^\\[.+?\\]$',
+        relevance: 0
+      },
+      // quoteblocks
+      {
+        className: 'blockquote',
+        begin: '^_{4,}\\n',
+        end: '\\n_{4,}$',
+        relevance: 10
+      },
+      // listing and literal blocks
+      {
+        className: 'code',
+        begin: '^[\\-\\.]{4,}\\n',
+        end: '\\n[\\-\\.]{4,}$',
+        relevance: 10
+      },
+      // passthrough blocks
+      {
+        begin: '^\\+{4,}\\n',
+        end: '\\n\\+{4,}$',
+        contains: [
+          {
+            begin: '<', end: '>',
+            subLanguage: 'xml',
+            relevance: 0
+          }
+        ],
+        relevance: 10
+      },
+      // lists (can only capture indicators)
+      {
+        className: 'bullet',
+        begin: '^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+'
+      },
+      // admonition
+      {
+        className: 'label',
+        begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+',
+        relevance: 10
+      },
+      // inline strong
+      {
+        className: 'strong',
+        // must not follow a word character or be followed by an asterisk or space
+        begin: '\\B\\*(?![\\*\\s])',
+        end: '(\\n{2}|\\*)',
+        // allow escaped asterisk followed by word char
+        contains: [
+          {
+            begin: '\\\\*\\w',
+            relevance: 0
+          }
+        ]
+      },
+      // inline emphasis
+      {
+        className: 'emphasis',
+        // must not follow a word character or be followed by a single quote or space
+        begin: '\\B\'(?![\'\\s])',
+        end: '(\\n{2}|\')',
+        // allow escaped single quote followed by word char
+        contains: [
+          {
+            begin: '\\\\\'\\w',
+            relevance: 0
+          }
+        ],
+        relevance: 0
+      },
+      // inline emphasis (alt)
+      {
+        className: 'emphasis',
+        // must not follow a word character or be followed by an underline or space
+        begin: '_(?![_\\s])',
+        end: '(\\n{2}|_)',
+        relevance: 0
+      },
+      // inline code snippets (TODO should get same treatment as strong and emphasis)
+      {
+        className: 'code',
+        begin: '(`.+?`|\\+.+?\\+)',
+        relevance: 0
+      },
+      // indented literal block
+      {
+        className: 'code',
+        begin: '^[ \\t]',
+        end: '$',
+        relevance: 0
+      },
+      // horizontal rules
+      {
+        className: 'horizontal_rule',
+        begin: '^\'{4,}[ \\t]*$',
+        relevance: 10
+      },
+      // images and links
+      {
+        begin: '(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]',
+        returnBegin: true,
+        contains: [
+          {
+            //className: 'macro',
+            begin: '(link|image:?):',
+            relevance: 0
+          },
+          {
+            className: 'link_url',
+            begin: '\\w',
+            end: '[^\\[]+',
+            relevance: 0
+          },
+          {
+            className: 'link_label',
+            begin: '\\[',
+            end: '\\]',
+            excludeBegin: true,
+            excludeEnd: true,
+            relevance: 0
+          }
+        ],
+        relevance: 10
+      }
+    ]
+  };
+}
diff --git a/src/languages/axapta.js b/src/languages/axapta.js
index f438483..549853e 100644
--- a/src/languages/axapta.js
+++ b/src/languages/axapta.js
@@ -5,9 +5,9 @@ Author: Dmitri Roudakov <dmitri at roudakov.ru>
 
 function(hljs) {
   return {
-    keywords: 'false int abstract private char interface boolean static null if for true ' +
-      'while long throw finally protected extends final implements return void enum else ' +
-      'break new catch byte super class case short default double public try this switch ' +
+    keywords: 'false int abstract private char boolean static null if for true ' +
+      'while long throw finally protected final return void enum else ' +
+      'break new catch byte super case short default double public try this switch ' +
       'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' +
       'order group by asc desc index hint like dispaly edit client server ttsbegin ' +
       'ttscommit str real date container anytype common div mod',
diff --git a/src/languages/bash.js b/src/languages/bash.js
index b55a6f8..89e58f1 100644
--- a/src/languages/bash.js
+++ b/src/languages/bash.js
@@ -1,58 +1,70 @@
 /*
 Language: Bash
 Author: vah <vahtenberg at gmail.com>
+Contributrors: Benjamin Pannell <contact at sierrasoftworks.com>
 */
 
 function(hljs) {
-  var BASH_LITERAL = 'true false';
-  var BASH_KEYWORD = 'if then else elif fi for break continue while in do done echo exit return set declare';
   var VAR1 = {
-    className: 'variable', begin: '\\$[a-zA-Z0-9_#]+'
+    className: 'variable', begin: /\$[\w\d#@][\w\d_]*/
   };
   var VAR2 = {
-    className: 'variable', begin: '\\${([^}]|\\\\})+}'
+    className: 'variable', begin: /\$\{(.*?)\}/
   };
   var QUOTE_STRING = {
     className: 'string',
-    begin: '"', end: '"',
-    illegal: '\\n',
-    contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
+    begin: /"/, end: /"/,
+    contains: [
+      hljs.BACKSLASH_ESCAPE,
+      VAR1,
+      VAR2,
+      {
+        className: 'variable',
+        begin: /\$\(/, end: /\)/,
+        contains: hljs.BACKSLASH_ESCAPE
+      }
+    ],
     relevance: 0
   };
   var APOS_STRING = {
     className: 'string',
-    begin: '\'', end: '\'',
-    contains: [{begin: '\'\''}],
-    relevance: 0
-  };
-  var TEST_CONDITION = {
-    className: 'test_condition',
-    begin: '', end: '',
-    contains: [QUOTE_STRING, APOS_STRING, VAR1, VAR2],
-    keywords: {
-      literal: BASH_LITERAL
-    },
+    begin: /'/, end: /'/,
     relevance: 0
   };
 
   return {
+    lexems: /-?[a-z]+/,
     keywords: {
-      keyword: BASH_KEYWORD,
-      literal: BASH_LITERAL
+      keyword:
+        'if then else elif fi for break continue while in do done exit return set '+
+        'declare case esac export exec',
+      literal:
+        'true false',
+      built_in:
+        'printf echo read cd pwd pushd popd dirs let eval unset typeset readonly '+
+        'getopts source shopt caller type hash bind help sudo',
+      operator:
+        '-ne -eq -lt -gt -f -d -e -s -l -a' // relevance booster
     },
     contains: [
       {
         className: 'shebang',
-        begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
+        begin: /^#![^\n]+sh\s*$/,
         relevance: 10
       },
-      VAR1,
-      VAR2,
+      {
+        className: 'function',
+        begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
+        returnBegin: true,
+        contains: [{className: 'title', begin: /\w[\w\d_]*/}],
+        relevance: 0
+      },
       hljs.HASH_COMMENT_MODE,
+      hljs.NUMBER_MODE,
       QUOTE_STRING,
       APOS_STRING,
-      hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
-      hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
+      VAR1,
+      VAR2
     ]
   };
 }
diff --git a/src/languages/clojure.js b/src/languages/clojure.js
index 71490a1..67c410b 100644
--- a/src/languages/clojure.js
+++ b/src/languages/clojure.js
@@ -73,11 +73,10 @@ function(hljs) {
   };
   var LIST = {
     className: 'list',
-    begin: '\\(', end: '\\)',
-    relevance: 0
+    begin: '\\(', end: '\\)'
   };
   var BODY = {
-    endsWithParent: true, excludeEnd: true,
+    endsWithParent: true,
     keywords: {literal: 'true false nil'},
     relevance: 0
   };
diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js
index e0c43e7..64ab522 100755
--- a/src/languages/coffeescript.js
+++ b/src/languages/coffeescript.js
@@ -1,7 +1,7 @@
 /*
 Language: CoffeeScript
 Author: Dmytrii Nagirniak <dnagir at gmail.com>
-Contributors: Oleg Efimov <efimovov at gmail.com>
+Contributors: Oleg Efimov <efimovov at gmail.com>, Cédric Néhémie <cedric.nehemie at gmail.com>
 Description: CoffeeScript is a programming language that transcompiles to JavaScript. For info about language see http://coffeescript.org/
 */
 
@@ -17,9 +17,12 @@ function(hljs) {
       // JS literals
       'true false null undefined ' +
       // Coffee literals
-      'yes no on off ',
-    reserved: 'case default function var void with const let enum export import native ' +
-      '__hasProp __extends __slice __bind __indexOf'
+      'yes no on off',
+    reserved:
+      'case default function var void with const let enum export import native ' +
+      '__hasProp __extends __slice __bind __indexOf',
+    built_in:
+      'npm require console print module exports global window document'
   };
   var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
   var TITLE = {className: 'title', begin: JS_IDENT_RE};
@@ -27,60 +30,85 @@ function(hljs) {
     className: 'subst',
     begin: '#\\{', end: '}',
     keywords: KEYWORDS,
-    contains: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]
   };
+  var EXPRESSIONS = [
+    // Numbers
+    hljs.BINARY_NUMBER_MODE,
+    hljs.inherit(hljs.C_NUMBER_MODE, {starts: {end: '(\\s*/)?', relevance: 0}}), // a number tries to eat the following slash to prevent treating it as a regexp
+    // Strings
+    {
+      className: 'string',
+      begin: '\'\'\'', end: '\'\'\'',
+      contains: [hljs.BACKSLASH_ESCAPE]
+    },
+    {
+      className: 'string',
+      begin: '\'', end: '\'',
+      contains: [hljs.BACKSLASH_ESCAPE],
+      relevance: 0
+    },
+    {
+      className: 'string',
+      begin: '"""', end: '"""',
+      contains: [hljs.BACKSLASH_ESCAPE, SUBST]
+    },
+    {
+      className: 'string',
+      begin: '"', end: '"',
+      contains: [hljs.BACKSLASH_ESCAPE, SUBST],
+      relevance: 0
+    },
+    // RegExps
+    {
+      className: 'regexp',
+      begin: '///', end: '///',
+      contains: [hljs.HASH_COMMENT_MODE]
+    },
+    {
+      className: 'regexp', begin: '//[gim]*',
+      relevance: 0
+    },
+    {
+      className: 'regexp',
+      begin: '/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)' // \S is required to parse x / 2 / 3 as two divisions
+    },
+
+    {
+      className: 'property',
+      begin: '@' + JS_IDENT_RE
+    },
+    {
+      begin: '`', end: '`',
+      excludeBegin: true, excludeEnd: true,
+      subLanguage: 'javascript'
+    }
+  ];
+  SUBST.contains = EXPRESSIONS;
 
   return {
     keywords: KEYWORDS,
-    contains: [
-      // Numbers
-      hljs.BINARY_NUMBER_MODE,
-      hljs.C_NUMBER_MODE,
-      // Strings
-      hljs.APOS_STRING_MODE,
-      {
-        className: 'string',
-        begin: '"""', end: '"""',
-        contains: [hljs.BACKSLASH_ESCAPE, SUBST]
-      },
-      {
-        className: 'string',
-        begin: '"', end: '"',
-        contains: [hljs.BACKSLASH_ESCAPE, SUBST],
-        relevance: 0
-      },
-      // Comments
+    contains: EXPRESSIONS.concat([
       {
         className: 'comment',
         begin: '###', end: '###'
       },
       hljs.HASH_COMMENT_MODE,
       {
-        className: 'regexp',
-        begin: '///', end: '///',
-        contains: [hljs.HASH_COMMENT_MODE]
-      },
-      {
-        className: 'regexp', begin: '//[gim]*'
-      },
-      {
-        className: 'regexp',
-        begin: '/\\S(\\\\.|[^\\n])*/[gim]*' // \S is required to parse x / 2 / 3 as two divisions
-      },
-      {
-        begin: '`', end: '`',
-        excludeBegin: true, excludeEnd: true,
-        subLanguage: 'javascript'
-      },
-      {
         className: 'function',
-        begin: JS_IDENT_RE + '\\s*=\\s*(\\(.+\\))?\\s*[-=]>',
+        begin: '(' + JS_IDENT_RE + '\\s*=\\s*)?(\\(.*\\))?\\s*[-=]>', end: '[-=]>',
         returnBegin: true,
         contains: [
           TITLE,
           {
             className: 'params',
-            begin: '\\(', end: '\\)'
+            begin: '\\(', returnBegin: true,
+            /* We need another contained nameless mode to not have every nested
+            pair of parens to be called "params" */
+            contains: [{
+              begin: /\(/, end: /\)/,
+              keywords: KEYWORDS,
+              contains: ['self'].concat(EXPRESSIONS)
+            }]
           }
         ]
       },
@@ -88,7 +116,7 @@ function(hljs) {
         className: 'class',
         beginWithKeyword: true, keywords: 'class',
         end: '$',
-        illegal: ':',
+        illegal: '[:\\[\\]]',
         contains: [
           {
             beginWithKeyword: true, keywords: 'extends',
@@ -100,9 +128,10 @@ function(hljs) {
         ]
       },
       {
-        className: 'property',
-        begin: '@' + JS_IDENT_RE
+        className: 'attribute',
+        begin: JS_IDENT_RE + ':', end: ':',
+        returnBegin: true, excludeEnd: true
       }
-    ]
+    ])
   };
 }
diff --git a/src/languages/cpp.js b/src/languages/cpp.js
index c31324e..a6b8c28 100644
--- a/src/languages/cpp.js
+++ b/src/languages/cpp.js
@@ -35,7 +35,11 @@ function(hljs) {
       hljs.C_NUMBER_MODE,
       {
         className: 'preprocessor',
-        begin: '#', end: '$'
+        begin: '#', end: '$',
+        contains: [
+          {begin: '<', end: '>', illegal: '\\n'},
+          hljs.C_LINE_COMMENT_MODE
+        ]
       },
       {
         className: 'stl_container',
diff --git a/src/languages/cs.js b/src/languages/cs.js
index 71d839e..1f1ee78 100644
--- a/src/languages/cs.js
+++ b/src/languages/cs.js
@@ -12,7 +12,7 @@ function(hljs) {
       'for foreach goto if implicit in int interface internal is lock long namespace new null ' +
       'object operator out override params private protected public readonly ref return sbyte ' +
       'sealed short sizeof stackalloc static string struct switch this throw true try typeof ' +
-      'uint ulong unchecked unsafe ushort using virtual volatile void while ' +
+      'uint ulong unchecked unsafe ushort using virtual volatile void while async await ' +
       // Contextual keywords.
       'ascending descending from get group into join let orderby partial select set value var '+
       'where yield',
diff --git a/src/languages/css.js b/src/languages/css.js
index 60ef02d..2ea58ff 100644
--- a/src/languages/css.js
+++ b/src/languages/css.js
@@ -3,10 +3,11 @@ Language: CSS
 */
 
 function(hljs) {
+  var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
   var FUNCTION = {
     className: 'function',
-    begin: hljs.IDENT_RE + '\\(', end: '\\)',
-    contains: [hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
+    begin: IDENT_RE + '\\(', end: '\\)',
+    contains: ['self', hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
   };
   return {
     case_insensitive: true,
@@ -41,16 +42,24 @@ function(hljs) {
                                  // because it doesn’t let it to be parsed as
                                  // a rule set but instead drops parser into
                                  // the default mode which is how it should be.
-        excludeEnd: true,
-        keywords: 'import page media charset',
         contains: [
-          FUNCTION,
-          hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
-          hljs.NUMBER_MODE
+          {
+            className: 'keyword',
+            begin: /\S+/
+          },
+          {
+            begin: /\s/, endsWithParent: true, excludeEnd: true,
+            relevance: 0,
+            contains: [
+              FUNCTION,
+              hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
+              hljs.NUMBER_MODE
+            ]
+          }
         ]
       },
       {
-        className: 'tag', begin: hljs.IDENT_RE,
+        className: 'tag', begin: IDENT_RE,
         relevance: 0
       },
       {
@@ -79,7 +88,7 @@ function(hljs) {
                     hljs.APOS_STRING_MODE,
                     hljs.C_BLOCK_COMMENT_MODE,
                     {
-                      className: 'hexcolor', begin: '\\#[0-9A-F]+'
+                      className: 'hexcolor', begin: '#[0-9A-Fa-f]+'
                     },
                     {
                       className: 'important', begin: '!important'
diff --git a/src/languages/django.js b/src/languages/django.js
index 77ea397..4e54a8a 100644
--- a/src/languages/django.js
+++ b/src/languages/django.js
@@ -37,7 +37,7 @@ function(hljs) {
 
   var FILTER = {
     className: 'filter',
-    begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
+    begin: '\\|[A-Za-z]+\\:?',
     keywords:
       'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
       'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
@@ -72,7 +72,8 @@ function(hljs) {
         'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
         'plural get_current_language language get_available_languages ' +
         'get_current_language_bidi get_language_info get_language_info_list localize ' +
-        'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone',
+        'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +
+        'verbatim',
       contains: [FILTER]
     },
     {
diff --git a/src/languages/fsharp.js b/src/languages/fsharp.js
new file mode 100644
index 0000000..754dfcf
--- /dev/null
+++ b/src/languages/fsharp.js
@@ -0,0 +1,56 @@
+/*
+Language: F#
+Author: Jonas Follesø <jonas at follesoe.no>
+Description: F# language definition.
+*/
+function(hljs) {
+  return {
+    keywords:
+      'abstract and as assert base begin class default delegate do done ' +
+      'downcast downto elif else end exception extern false finally for ' +
+      'fun function global if in inherit inline interface internal lazy let ' +
+      'match member module mutable namespace new null of open or ' +
+      'override private public rec return sig static struct then to ' +
+      'true try type upcast use val void when while with yield',
+    contains: [
+
+      {
+        className: 'string',
+        begin: '@"', end: '"',
+        contains: [{begin: '""'}]
+      },
+      {
+        className: 'string',
+        begin: '"""', end: '"""'
+      },
+      {
+        className: 'comment',
+        begin: '//', end: '$', returnBegin: true
+      },
+      {
+        className: 'comment',
+        begin: '\\(\\*', end: '\\*\\)'
+      },
+      {
+        className: 'class',
+        beginWithKeyword: true, end: '\\(|=|$',
+        keywords: 'type',
+        contains: [
+          {
+            className: 'title',
+            begin: hljs.UNDERSCORE_IDENT_RE
+          }
+        ]
+      },
+      {
+        className: 'annotation',
+        begin: '\\[<', end: '>\\]'
+      },
+      hljs.C_LINE_COMMENT_MODE,
+      hljs.C_BLOCK_COMMENT_MODE,
+      hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
+      hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
+      hljs.C_NUMBER_MODE
+    ]
+  }
+}
diff --git a/src/languages/haml.js b/src/languages/haml.js
new file mode 100644
index 0000000..43b4616
--- /dev/null
+++ b/src/languages/haml.js
@@ -0,0 +1,142 @@
+/*
+Language: Haml
+Requires: ruby.js
+Author: Dan Allen <dan.j.allen at gmail.com>
+Website: http://google.com/profiles/dan.j.allen
+*/
+
+// TODO support filter tags like :javascript, support inline HTML
+function(hljs) {
+  return {
+    case_insensitive: true,
+    contains: [
+      {
+        className: 'doctype',
+        begin: '^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$',
+        relevance: 10
+      },
+      {
+        className: 'comment',
+        // FIXME these comments should be allowed to span indented lines
+        begin: '^\\s*(-#|/).*$',
+        relevance: 0
+      },
+      {
+        begin: '^\\s*-(?!#)',
+        starts: {
+          end: '\\n',
+          subLanguage: 'ruby'
+        },
+        relevance: 0
+      },
+      {
+        className: 'tag',
+        begin: '^\\s*%',
+        contains: [
+          {
+            className: 'title',
+            begin: '\\w+',
+            relevance: 0
+          },
+          {
+            className: 'value',
+            begin: '[#\\.]\\w+',
+            relevance: 0
+          },
+          {
+            begin: '{\\s*',
+            end: '\\s*}',
+            excludeEnd: true,
+            contains: [
+              {
+                //className: 'attribute',
+                begin: ':\\w+\\s*=>',
+                end: ',\\s+',
+                returnBegin: true,
+                endsWithParent: true,
+                relevance: 0,
+                contains: [
+                  {
+                    className: 'symbol',
+                    begin: ':\\w+',
+                    relevance: 0
+                  },
+                  {
+                    className: 'string',
+                    begin: '"',
+                    end: '"',
+                    relevance: 0
+                  },
+                  {
+                    className: 'string',
+                    begin: '\'',
+                    end: '\'',
+                    relevance: 0
+                  },
+                  {
+                    begin: '\\w+',
+                    relevance: 0
+                  }
+                ]
+              },
+            ],
+            relevance: 0
+          },
+          {
+            begin: '\\(\\s*',
+            end: '\\s*\\)',
+            excludeEnd: true,
+            contains: [
+              {
+                //className: 'attribute',
+                begin: '\\w+\\s*=',
+                end: '\\s+',
+                returnBegin: true,
+                endsWithParent: true,
+                relevance: 0,
+                contains: [
+                  {
+                    className: 'attribute',
+                    begin: '\\w+',
+                    relevance: 0
+                  },
+                  {
+                    className: 'string',
+                    begin: '"',
+                    end: '"',
+                    relevance: 0
+                  },
+                  {
+                    className: 'string',
+                    begin: '\'',
+                    end: '\'',
+                    relevance: 0
+                  },
+                  {
+                    begin: '\\w+',
+                    relevance: 0
+                  }
+                ]
+              },
+            ],
+            relevance: 0
+          }
+        ],
+        relevance: 10
+      },
+      {
+        className: 'bullet',
+        begin: '^\\s*[=~]\\s*',
+        relevance: 0
+      },
+      {
+        begin: '#{',
+        starts: {
+          end: '}',
+          subLanguage: 'ruby'
+        },
+        relevance: 0
+      }
+    ]
+  };
+}
diff --git a/src/languages/handlebars.js b/src/languages/handlebars.js
new file mode 100644
index 0000000..73d2a15
--- /dev/null
+++ b/src/languages/handlebars.js
@@ -0,0 +1,64 @@
+/*
+Language: Handlebars
+Requires: xml.js
+Author: Robin Ward <robin.ward at gmail.com>
+Description: Matcher for Handlebars as well as EmberJS additions.
+*/
+
+function(hljs) {
+
+  function copy(mode, parent) {
+    var result = {};
+    for (var key in mode) {
+      if (key != 'contains') {
+        result[key] = mode[key];
+      }
+      var contains = [];
+      for (var i = 0; mode.contains && i < mode.contains.length; i++) {
+        contains.push(copy(mode.contains[i], mode));
+      }
+      contains = HANDLEBARS_CONTAINS.concat(contains);
+      if (contains.length) {
+        result.contains = contains;
+      }
+    }
+    return result;
+  }
+
+  var EXPRESSION_KEYWORDS = "each in with if else unless bindattr action collection debugger log outlet template unbound view yield";
+
+  var VARIABLE_CONTAINS = 
+  {
+    className: 'variable', begin: '[a-zA-Z\.]+',
+    keywords: EXPRESSION_KEYWORDS
+  };
+
+  var HANDLEBARS_CONTAINS = [
+    {
+      className: 'expression',
+      begin: '{{', end: '}}',
+      contains: [
+        {
+          className: 'begin-block', begin: '\#[a-zA-Z\ \.]+',
+          keywords: EXPRESSION_KEYWORDS
+        },
+        {
+          className: 'string',
+          begin: '"', end: '"'
+        },        
+        {
+          className: 'end-block', begin: '\\\/[a-zA-Z\ \.]+',
+          keywords: EXPRESSION_KEYWORDS
+        },        
+        {
+          className: 'variable', begin: '[a-zA-Z\.]+',
+          keywords: EXPRESSION_KEYWORDS
+        }               
+      ]
+    }
+  ];
+
+  var result = copy(hljs.LANGUAGES.xml);
+  result.case_insensitive = true;
+  return result;
+}
diff --git a/src/languages/haskell.js b/src/languages/haskell.js
index 912bf97..da11423 100644
--- a/src/languages/haskell.js
+++ b/src/languages/haskell.js
@@ -12,6 +12,7 @@ function(hljs) {
   var CONTAINER = {
     className: 'container',
     begin: '\\(', end: '\\)',
+    illegal: '"',
     contains: [
       {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
       {className: 'title', begin: '[_a-z][\\w\']*'}
@@ -82,7 +83,8 @@ function(hljs) {
       TYPE,
       {
         className: 'title', begin: '^[_a-z][\\w\']*'
-      }
+      },
+      {begin: '->|<-'} // No markup, relevance booster
     ]
   };
 }
diff --git a/src/languages/ini.js b/src/languages/ini.js
index 9ffd371..c576be0 100644
--- a/src/languages/ini.js
+++ b/src/languages/ini.js
@@ -23,7 +23,8 @@ function(hljs) {
             className: 'value',
             endsWithParent: true,
             keywords: 'on off true false yes no',
-            contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE]
+            contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE],
+            relevance: 0
           }
         ]
       }
diff --git a/src/languages/java.js b/src/languages/java.js
index 16af124..d973695 100644
--- a/src/languages/java.js
+++ b/src/languages/java.js
@@ -15,7 +15,7 @@ function(hljs) {
         className: 'javadoc',
         begin: '/\\*\\*', end: '\\*/',
         contains: [{
-          className: 'javadoctag', begin: '@[A-Za-z]+'
+          className: 'javadoctag', begin: '(^|\\s)@[A-Za-z]+'
         }],
         relevance: 10
       },
@@ -27,6 +27,7 @@ function(hljs) {
         className: 'class',
         beginWithKeyword: true, end: '{',
         keywords: 'class interface',
+        excludeEnd: true,
         illegal: ':',
         contains: [
           {
diff --git a/src/languages/javascript.js b/src/languages/javascript.js
index e8136f3..a0e87a5 100644
--- a/src/languages/javascript.js
+++ b/src/languages/javascript.js
@@ -24,14 +24,9 @@ function(hljs) {
         contains: [
           hljs.C_LINE_COMMENT_MODE,
           hljs.C_BLOCK_COMMENT_MODE,
-          {
-            className: 'regexp',
-            begin: '/', end: '/[gim]*',
-            illegal: '\\n',
-            contains: [{begin: '\\\\/'}]
-          },
+          hljs.REGEXP_MODE,
           { // E4X
-            begin: '<', end: '>;',
+            begin: /</, end: />;/,
             subLanguage: 'xml'
           }
         ],
@@ -39,23 +34,23 @@ function(hljs) {
       },
       {
         className: 'function',
-        beginWithKeyword: true, end: '{',
+        beginWithKeyword: true, end: /{/,
         keywords: 'function',
         contains: [
           {
-            className: 'title', begin: '[A-Za-z$_][0-9A-Za-z$_]*'
+            className: 'title', begin: /[A-Za-z$_][0-9A-Za-z$_]*/
           },
           {
             className: 'params',
-            begin: '\\(', end: '\\)',
+            begin: /\(/, end: /\)/,
             contains: [
               hljs.C_LINE_COMMENT_MODE,
               hljs.C_BLOCK_COMMENT_MODE
             ],
-            illegal: '["\'\\(]'
+            illegal: /["'\(]/
           }
         ],
-        illegal: '\\[|%'
+        illegal: /\[|%/
       }
     ]
   };
diff --git a/src/languages/lasso.js b/src/languages/lasso.js
new file mode 100644
index 0000000..60a97de
--- /dev/null
+++ b/src/languages/lasso.js
@@ -0,0 +1,112 @@
+/*
+Language: Lasso
+Author: Eric Knibbe <eric at lassosoft.com>
+Description: Lasso is a language and server platform for database-driven web applications. This definition handles Lasso 9 syntax and LassoScript for Lasso 8.6 and earlier.
+*/
+
+function(hljs) {
+  var LASSO_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*|&[lg]t;';
+  var LASSO_START = '<\\?(lasso(script)?|=)';
+  return {
+    case_insensitive: true,
+    lexems: LASSO_IDENT_RE,
+    keywords: {
+      literal:
+        'true false none minimal full all infinity nan and or not ' +
+        'bw ew cn lt lte gt gte eq neq ft rx nrx',
+      built_in:
+        'array date decimal duration integer map pair string tag xml null ' +
+        'list queue set stack staticarray local var variable data global ' +
+        'self inherited void',
+      keyword:
+        'error_code error_msg error_pop error_push error_reset cache ' +
+        'database_names database_schemanames database_tablenames define_tag ' +
+        'define_type email_batch encode_set html_comment handle handle_error ' +
+        'header if inline iterate ljax_target link link_currentaction ' +
+        'link_currentgroup link_currentrecord link_detail link_firstgroup ' +
+        'link_firstrecord link_lastgroup link_lastrecord link_nextgroup ' +
+        'link_nextrecord link_prevgroup link_prevrecord log loop ' +
+        'namespace_using output_none portal private protect records referer ' +
+        'referrer repeating resultset rows search_args search_arguments ' +
+        'select sort_args sort_arguments thread_atomic value_list while ' +
+        'abort case else if_empty if_false if_null if_true loop_abort ' +
+        'loop_continue loop_count params params_up return return_value ' +
+        'run_children soap_definetag soap_lastrequest soap_lastresponse ' +
+        'tag_name ascending average by define descending do equals ' +
+        'frozen group handle_failure import in into join let match max ' +
+        'min on order parent protected provide public require skip ' +
+        'split_thread sum take thread to trait type where with yield'
+    },
+    contains: [
+      {
+        className: 'preprocessor',
+        begin: '\\]|\\?>',
+        relevance: 0,
+        starts: {
+          className: 'markup',
+          end: '\\[|' + LASSO_START,
+          returnEnd: true
+        }
+      },
+      {
+        className: 'preprocessor',
+        begin: '\\[noprocess\\]',
+        starts: {
+          className: 'markup',
+          end: '\\[/noprocess\\]',
+          returnEnd: true
+        }
+      },
+      {
+        className: 'preprocessor',
+        begin: '\\[no_square_brackets|\\[/noprocess|' + LASSO_START
+      },
+      {
+        className: 'preprocessor',
+        begin: '\\[',
+        relevance: 0
+      },
+      {
+        className: 'shebang',
+        begin: '^#!.+lasso9\\b',
+        relevance: 10
+      },
+      hljs.C_LINE_COMMENT_MODE,
+      {
+        className: 'javadoc',
+        begin: '/\\*\\*!', end: '\\*/'
+      },
+      hljs.C_BLOCK_COMMENT_MODE,
+      hljs.C_NUMBER_MODE,
+      hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
+      hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
+      {
+        className: 'string',
+        begin: '`', end: '`'
+      },
+      {
+        className: 'variable',
+        begin: '#\\d+|[#$]' + LASSO_IDENT_RE
+      },
+      {
+        className: 'tag',
+        begin: '::', end: LASSO_IDENT_RE
+      },
+      {
+        className: 'attribute',
+        begin: '\\.\\.\\.|-' + hljs.UNDERSCORE_IDENT_RE
+      },
+      {
+        className: 'class',
+        beginWithKeyword: true, keywords: 'define',
+        excludeEnd: true, end: '\\(|=>',
+        contains: [
+          {
+            className: 'title',
+            begin: hljs.UNDERSCORE_IDENT_RE + '=?'
+          }
+        ]
+      }
+    ]
+  };
+}
diff --git a/src/languages/lisp.js b/src/languages/lisp.js
index 9f704e0..8cfdbeb 100644
--- a/src/languages/lisp.js
+++ b/src/languages/lisp.js
@@ -5,8 +5,12 @@ Author: Vasily Polovnyov <vast at whiteants.net>
 */
 
 function(hljs) {
-  var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*';
+  var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*';
   var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
+  var SHEBANG = {
+    className: 'shebang',
+    begin: '^#!', end: '$'
+  };
   var LITERAL = {
     className: 'literal',
     begin: '\\b(t{1}|nil)\\b'
@@ -66,8 +70,8 @@ function(hljs) {
     begin: '\\(', end: '\\)'
   };
   var BODY = {
-    className: 'body',
-    endsWithParent: true, excludeEnd: true
+    endsWithParent: true,
+    relevance: 0
   };
   LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
   BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
@@ -75,6 +79,7 @@ function(hljs) {
   return {
     illegal: '[^\\s]',
     contains: NUMBERS.concat([
+      SHEBANG,
       LITERAL,
       STRING,
       COMMENT,
diff --git a/src/languages/mizar.js b/src/languages/mizar.js
new file mode 100644
index 0000000..5f70995
--- /dev/null
+++ b/src/languages/mizar.js
@@ -0,0 +1,24 @@
+/*
+  Language: Mizar
+  Author: Kelley van Evert <kelleyvanevert at gmail.com>
+*/
+
+function(hljs) {
+  return {
+    keywords: [
+      "environ vocabularies notations constructors definitions registrations theorems schemes requirements",
+      "begin end definition registration cluster existence pred func defpred deffunc theorem proof",
+      "let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from",
+      "be being by means equals implies iff redefine define now not or attr is mode suppose per cases set",
+      "thesis contradiction scheme reserve struct",
+      "correctness compatibility coherence symmetry assymetry reflexivity irreflexivity",
+      "connectedness uniqueness commutativity idempotence involutiveness projectivity"
+    ].join(" "),
+    contains: [
+      {
+        className: "comment",
+        begin: "::", end: "$"
+      }
+    ]
+  };
+}
diff --git a/src/languages/nginx.js b/src/languages/nginx.js
index f8881d9..e1796d6 100644
--- a/src/languages/nginx.js
+++ b/src/languages/nginx.js
@@ -92,7 +92,8 @@ function(hljs) {
             begin: hljs.UNDERSCORE_IDENT_RE,
             starts: DEFAULT
           }
-        ]
+        ],
+        relevance: 0
       }
     ],
     illegal: '[^\\s\\}]'
diff --git a/src/languages/objectivec.js b/src/languages/objectivec.js
index e30b068..2733cd1 100644
--- a/src/languages/objectivec.js
+++ b/src/languages/objectivec.js
@@ -9,10 +9,10 @@ function(hljs) {
     keyword:
       'int float while private char catch export sizeof typedef const struct for union ' +
       'unsigned long volatile static protected bool mutable if public do return goto void ' +
-      'enum else break extern class asm case short default double throw register explicit ' +
+      'enum else break extern asm case short default double throw register explicit ' +
       'signed typename try this switch continue wchar_t inline readonly assign property ' +
-      'protocol self synchronized end synthesize id optional required implementation ' +
-      'nonatomic interface super unichar finally dynamic IBOutlet IBAction selector strong ' +
+      'self synchronized end synthesize id optional required ' +
+      'nonatomic super unichar finally dynamic IBOutlet IBAction selector strong ' +
       'weak readonly',
     literal:
     	'false true FALSE TRUE nil YES NO NULL',
@@ -27,7 +27,7 @@ function(hljs) {
       'NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor ' +
       'UIFont UIApplication NSNotFound NSNotificationCenter NSNotification ' +
       'UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar ' +
-      'NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection class ' +
+      'NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection ' +
       'UIInterfaceOrientation MPMoviePlayerController dispatch_once_t ' +
       'dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
   };
@@ -81,7 +81,8 @@ function(hljs) {
       },
       {
         className: 'variable',
-        begin: '\\.'+hljs.UNDERSCORE_IDENT_RE
+        begin: '\\.'+hljs.UNDERSCORE_IDENT_RE,
+        relevance: 0
       }
     ]
   };
diff --git a/src/languages/parser3.js b/src/languages/parser3.js
index e906c28..f72b8d5 100644
--- a/src/languages/parser3.js
+++ b/src/languages/parser3.js
@@ -6,7 +6,7 @@ Author: Oleg Volchkov <oleg at volchkov.net>
 
 function(hljs) {
   return {
-    subLanguage: 'xml',
+    subLanguage: 'xml', relevance: 0,
     contains: [
       {
         className: 'comment',
diff --git a/src/languages/profile.js b/src/languages/profile.js
index 793b565..801d9db 100644
--- a/src/languages/profile.js
+++ b/src/languages/profile.js
@@ -9,7 +9,7 @@ function(hljs) {
     contains: [
       hljs.C_NUMBER_MODE,
       {
-        className: 'builtin',
+        className: 'built_in',
         begin: '{', end: '}$',
         excludeBegin: true, excludeEnd: true,
         contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE],
diff --git a/src/languages/python.js b/src/languages/python.js
index cb77db4..c69d922 100644
--- a/src/languages/python.js
+++ b/src/languages/python.js
@@ -4,41 +4,41 @@ Language: Python
 
 function(hljs) {
   var PROMPT = {
-    className: 'prompt',  begin: '^(>>>|\\.\\.\\.) '
+    className: 'prompt',  begin: /^(>>>|\.\.\.) /
   }
   var STRINGS = [
     {
       className: 'string',
-      begin: '(u|b)?r?\'\'\'', end: '\'\'\'',
+      begin: /(u|b)?r?'''/, end: /'''/,
       contains: [PROMPT],
       relevance: 10
     },
     {
       className: 'string',
-      begin: '(u|b)?r?"""', end: '"""',
+      begin: /(u|b)?r?"""/, end: /"""/,
       contains: [PROMPT],
       relevance: 10
     },
     {
       className: 'string',
-      begin: '(u|r|ur)\'', end: '\'',
+      begin: /(u|r|ur)'/, end: /'/,
       contains: [hljs.BACKSLASH_ESCAPE],
       relevance: 10
     },
     {
       className: 'string',
-      begin: '(u|r|ur)"', end: '"',
+      begin: /(u|r|ur)"/, end: /"/,
       contains: [hljs.BACKSLASH_ESCAPE],
       relevance: 10
     },
     {
       className: 'string',
-      begin: '(b|br)\'', end: '\'',
+      begin: /(b|br)'/, end: /'/,
       contains: [hljs.BACKSLASH_ESCAPE]
     },
     {
       className: 'string',
-      begin: '(b|br)"', end: '"',
+      begin: /(b|br)"/, end: /"/,
       contains: [hljs.BACKSLASH_ESCAPE]
     }
   ].concat([
@@ -50,12 +50,12 @@ function(hljs) {
   };
   var PARAMS = {
     className: 'params',
-    begin: '\\(', end: '\\)',
+    begin: /\(/, end: /\)/,
     contains: ['self', hljs.C_NUMBER_MODE, PROMPT].concat(STRINGS)
   };
   var FUNC_CLASS_PROTO = {
-    beginWithKeyword: true, end: ':',
-    illegal: '[${=;\\n]',
+    beginWithKeyword: true, end: /:/,
+    illegal: /[${=;\n]/,
     contains: [TITLE, PARAMS],
     relevance: 10
   };
@@ -69,7 +69,7 @@ function(hljs) {
       built_in:
         'None True False Ellipsis NotImplemented'
     },
-    illegal: '(</|->|\\?)',
+    illegal: /(<\/|->|\?)/,
     contains: STRINGS.concat([
       PROMPT,
       hljs.HASH_COMMENT_MODE,
@@ -78,10 +78,10 @@ function(hljs) {
       hljs.C_NUMBER_MODE,
       {
         className: 'decorator',
-        begin: '@', end: '$'
+        begin: /@/, end: /$/
       },
       {
-        begin: '\\b(print|exec)\\(' // don’t highlight keywords-turned-functions in Python 3
+        begin: /\b(print|exec)\(/ // don’t highlight keywords-turned-functions in Python 3
       }
     ])
   };
diff --git a/src/languages/ruleslanguage.js b/src/languages/ruleslanguage.js
new file mode 100644
index 0000000..f112f74
--- /dev/null
+++ b/src/languages/ruleslanguage.js
@@ -0,0 +1,62 @@
+/*
+Language: Oracle Rules Language
+Author: Jason Jacobson <jason.a.jacobson at gmail.com>
+Description: The Oracle Utilities Rules Language is used to program the Oracle Utilities Applications acquired from LODESTAR Corporation.  The products include Billing Component, LPSS, Pricing Component etc. through version 1.6.1.
+*/
+
+function(hljs) {
+  return {
+    keywords: {
+       keyword: 'BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE ' +
+         'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' + 
+         'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' + 
+         'INTDCREATEHANDLE|5 INTDCREATEMASK|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 ' + 
+         'INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 ' + 
+         'INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 ' + 
+         'INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 ' + 
+         'INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 ' + 
+         'INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 ' + 
+         'INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 ' + 
+         'INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 ' + 
+         'INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 ' + 
+         'INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 ' + 
+         'INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 ' + 
+         'INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 ' + 
+         'MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER ' +
+         'OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE ' +
+         'NOVALUE SECTION WARN DELETE SAVE SAVE_UPDATE CLEAR DETERMINANT LABEL REPORT REVENUE ABORT CALL DONE LEAVE EACH ' + 
+         'IN LIST NOVALUE FROM TOTAL CHARGE BLOCK AND OR CSV_FILE BILL_PERIOD RATE_CODE AUXILIARY_DEMAND ' + 
+         'UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ' + 
+         'ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE ' + 
+         'GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE ' + 
+         'SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING ' + 
+         'DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF ' + 
+         'MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY ' + 
+         'YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE ' + 
+         'COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR ' + 
+         'READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ' + 
+         'ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE ' + 
+         'EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE ' + 
+         'SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL ' + 
+         'COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN ' + 
+         'MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING ' + 
+         'FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM ABORT WARN ' + 
+         'NUMDAYS RATE_CODE READ_DATE STAGING',
+       built_in: 'IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML ' + 
+         'DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT ' + 
+         'DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE ' + 
+         'DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT ' + 
+         'DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME'
+    },
+    contains: [
+      hljs.C_LINE_COMMENT_MODE,
+      hljs.C_BLOCK_COMMENT_MODE,
+      hljs.APOS_STRING_MODE,
+      hljs.QUOTE_STRING_MODE,
+      hljs.C_NUMBER_MODE,
+      { className: 'array',
+        begin: '\#[a-zA-Z\ \.]+'
+      }
+    ]
+  };
+}
\ No newline at end of file
diff --git a/src/languages/rust.js b/src/languages/rust.js
index 8887ffb..8f4cc6b 100644
--- a/src/languages/rust.js
+++ b/src/languages/rust.js
@@ -14,10 +14,11 @@ function(hljs) {
     relevance: 0
   };
   var KEYWORDS =
-    'alt any as assert be bind block bool break char check claim const cont dir do else enum ' +
-    'export f32 f64 fail false float fn for i16 i32 i64 i8 if iface impl import in int let ' +
-    'log mod mutable native note of prove pure resource ret self str syntax true type u16 u32 ' +
-    'u64 u8 uint unchecked unsafe use vec while';
+    'assert bool break char check claim comm const cont copy dir do drop ' +
+    'else enum extern export f32 f64 fail false float fn for i16 i32 i64 i8 ' +
+    'if impl int let log loop match mod move mut priv pub pure ref return ' +
+    'self static str struct task true trait type u16 u32 u64 u8 uint unsafe ' +
+    'use vec while';
   return {
     keywords: KEYWORDS,
     illegal: '</',
@@ -45,7 +46,7 @@ function(hljs) {
       },
       {
         beginWithKeyword: true, end: '({|<)',
-        keywords: 'iface enum',
+        keywords: 'trait enum',
         contains: [TITLE],
         illegal: '\\S'
       }
diff --git a/src/languages/scss.js b/src/languages/scss.js
new file mode 100644
index 0000000..29bcc51
--- /dev/null
+++ b/src/languages/scss.js
@@ -0,0 +1,114 @@
+/*
+Language: SCSS
+Author: Kurt Emch <kurt at kurtemch.com>
+*/
+function(hljs) {
+  var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';
+  var FUNCTION = {
+    className: 'function',
+    begin: IDENT_RE + '\\(', end: '\\)',
+    contains: ['self', hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
+  };
+  var HEXCOLOR = {
+    className: 'hexcolor', begin: '#[0-9A-Fa-f]+'
+  };
+  var DEF_INTERNALS = {
+    className: 'attribute',
+    begin: '[A-Z\\_\\.\\-]+', end: ':',
+    excludeEnd: true,
+    illegal: '[^\\s]',
+    starts: {
+      className: 'value',
+      endsWithParent: true, excludeEnd: true,
+      contains: [
+        FUNCTION,
+        HEXCOLOR,
+        hljs.NUMBER_MODE,
+        hljs.QUOTE_STRING_MODE,
+        hljs.APOS_STRING_MODE,
+        hljs.C_BLOCK_COMMENT_MODE,
+        {
+          className: 'important', begin: '!important'
+        }
+      ]
+    }
+  };
+  return {
+    case_insensitive: true,
+    illegal: '[=/|\']',
+    contains: [
+      hljs.C_LINE_COMMENT_MODE,
+      hljs.C_BLOCK_COMMENT_MODE,
+      {
+        className: 'function',
+        begin: IDENT_RE + '\\(', end: '\\)',
+        contains: ['self', hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
+      },
+      {
+        className: 'id', begin: '\\#[A-Za-z0-9_-]+',
+        relevance: 0
+      },
+      {
+        className: 'class', begin: '\\.[A-Za-z0-9_-]+',
+        relevance: 0
+      },
+      {
+        className: 'attr_selector',
+        begin: '\\[', end: '\\]',
+        illegal: '$'
+      },
+      {
+        className: 'tag', // begin: IDENT_RE, end: '[,|\\s]'
+        begin: '\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|st [...]
+        relevance: 0
+      },
+      {
+        className: 'pseudo',
+        begin: ':(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)'
+      },
+      {
+        className: 'pseudo',
+        begin: '::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)'
+      },
+      {
+        className: 'attribute',
+        begin: '\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|ri [...]
+        illegal: '[^\\s]'
+      },
+      {
+        className: 'value',
+        begin: '\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newsp [...]
+      },
+      {
+        className: 'value',
+        begin: ':', end: ';',
+        contains: [
+          HEXCOLOR,
+          hljs.NUMBER_MODE,
+          hljs.QUOTE_STRING_MODE,
+          hljs.APOS_STRING_MODE,
+          {
+            className: 'important', begin: '!important'
+          }
+        ]
+      },
+      {
+        className: 'at_rule',
+        begin: '@', end: '[{;]',
+        keywords: 'mixin include for extend charset import media page font-face namespace',
+        contains: [
+          FUNCTION,
+          hljs.QUOTE_STRING_MODE,
+          hljs.APOS_STRING_MODE,
+          HEXCOLOR,
+          hljs.NUMBER_MODE,
+          {
+            className: 'preprocessor',
+            begin: '\\s[A-Za-z0-9_.-]+',
+            relevance: 0
+          }
+        ]
+      }
+    ]
+  };
+}
diff --git a/src/languages/smalltalk.js b/src/languages/smalltalk.js
index f8346e6..703991a 100644
--- a/src/languages/smalltalk.js
+++ b/src/languages/smalltalk.js
@@ -36,7 +36,10 @@ function(hljs) {
       CHAR,
       {
         className: 'localvars',
-        begin: '\\|\\s*((' + VAR_IDENT_RE + ')\\s*)+\\|'
+        // This looks more complicated than needed to avoid combinatorial
+        // explosion under V8. It effectively means `| var1 var2 ... |` with
+        // whitespace adjacent to `|` being optional.
+        begin: '\\|\\s*' + VAR_IDENT_RE + '(\\s+' + VAR_IDENT_RE + ')*\\s*\\|'
       },
       {
         className: 'array',
diff --git a/src/languages/sql.js b/src/languages/sql.js
index 10e90c6..f4083dd 100644
--- a/src/languages/sql.js
+++ b/src/languages/sql.js
@@ -8,7 +8,7 @@ function(hljs) {
     contains: [
       {
         className: 'operator',
-        begin: '(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)', // negative look-ahead here is specifically to prevent stomping on SmallTalk
+        begin: '(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)', // negative look-ahead here is specifically to prevent stomping on SmallTalk
         end: ';', endsWithParent: true,
         keywords: {
           keyword: 'all partial global month current_timestamp using go revoke smallint ' +
@@ -30,7 +30,7 @@ function(hljs) {
             'privileges when cross check write current_date pad begin temporary exec time ' +
             'update catalog user sql date on identity timezone_hour natural whenever interval ' +
             'work order cascade diagnostics nchar having left call do handler load replace ' +
-            'truncate start lock show pragma exists number',
+            'truncate start lock show pragma exists number trigger if before after each row',
           aggregate: 'count sum min max avg'
         },
         contains: [
diff --git a/src/languages/vala.js b/src/languages/vala.js
index eed1e4d..47c28f0 100644
--- a/src/languages/vala.js
+++ b/src/languages/vala.js
@@ -31,12 +31,9 @@ function(hljs) {
         className: 'class',
         beginWithKeyword: true, end: '{',
         keywords: 'class interface delegate namespace',
+        illegal: '[^,:\\n\\s\\.]',
         contains: [
           {
-            beginWithKeyword: true,
-            keywords: 'extends implements'
-          },
-          {
             className: 'title',
             begin: hljs.UNDERSCORE_IDENT_RE
           }
diff --git a/src/languages/vbnet.js b/src/languages/vbnet.js
new file mode 100644
index 0000000..77ff988
--- /dev/null
+++ b/src/languages/vbnet.js
@@ -0,0 +1,54 @@
+/*
+Language: VB.NET
+Author: Poren Chiang <ren.chiang at gmail.com>
+*/
+
+function(hljs) {
+  return {
+    case_insensitive: true,
+    keywords: {
+      keyword:
+        'addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval ' + /* a-b */
+        'call case catch class compare const continue custom declare default delegate dim distinct do ' + /* c-d */
+        'each equals else elseif end enum erase error event exit explicit finally for friend from function ' + /* e-f */
+        'get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue ' + /* g-i */
+        'join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass ' + /* j-m */
+        'namespace narrowing new next not notinheritable notoverridable ' + /* n */
+        'of off on operator option optional or order orelse overloads overridable overrides ' + /* o */
+        'paramarray partial preserve private property protected public ' + /* p */
+        'raiseevent readonly redim rem removehandler resume return ' + /* r */
+        'select set shadows shared skip static step stop structure strict sub synclock ' + /* s */
+        'take text then throw to try unicode until using when where while widening with withevents writeonly xor', /* t-x */
+      built_in:
+        'boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype ' +  /* b-c */
+        'date decimal directcast double gettype getxmlnamespace iif integer long object ' + /* d-o */
+        'sbyte short single string trycast typeof uinteger ulong ushort', /* s-u */
+      literal:
+        'true false nothing'
+    },
+    illegal: '(//|endif|gosub|variant|wend)', /* reserved deprecated keywords */
+    contains: [
+      hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
+      {
+        className: 'comment',
+        begin: '\'', end: '$', returnBegin: true,
+        contains: [
+          {
+            className: 'xmlDocTag',
+            begin: '\'\'\'|<!--|-->'
+          },
+          {
+            className: 'xmlDocTag',
+            begin: '</?', end: '>'
+          },
+          ]
+      },
+      hljs.C_NUMBER_MODE,
+      {
+        className: 'preprocessor',
+        begin: '#', end: '$',
+        keywords: 'if else elseif end region externalsource'
+      },
+    ]
+  };
+}
diff --git a/src/languages/xml.js b/src/languages/xml.js
index 8f208f1..39d2fc8 100644
--- a/src/languages/xml.js
+++ b/src/languages/xml.js
@@ -6,6 +6,7 @@ function(hljs) {
   var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
   var TAG_INTERNALS = {
     endsWithParent: true,
+    relevance: 0,
     contains: [
       {
         className: 'attribute',
@@ -93,9 +94,10 @@ function(hljs) {
       {
         className: 'tag',
         begin: '</?', end: '/?>',
+        relevance: 0,
         contains: [
           {
-            className: 'title', begin: '[^ />]+'
+            className: 'title', begin: '[^ /><]+'
           },
           TAG_INTERNALS
         ]
diff --git a/src/package.json b/src/package.json
index b046f64..e744516 100644
--- a/src/package.json
+++ b/src/package.json
@@ -1,8 +1,8 @@
 { "name" : "highlight.js"
 , "description" : "Syntax highlighting with language autodetection."
 , "keywords" : ["highlight", "syntax"]
-, "homepage" : "http://softwaremaniacs.org/soft/highlight/en/"
-, "version" : "7.3.0"
+, "homepage" : "http://highlightjs.org/"
+, "version" : "7.4.0"
 , "author" :
   { "name": "Ivan Sagalaev"
   , "email": "maniac at softwaremaniacs.org"
diff --git a/src/styles/arta.css b/src/styles/arta.css
index b7257da..049e383 100644
--- a/src/styles/arta.css
+++ b/src/styles/arta.css
@@ -41,7 +41,8 @@ pre .xml .attribute,
 pre .smalltalk .char,
 pre .xml .value,
 pre .ini .value,
-pre .clojure .attribute
+pre .clojure .attribute,
+pre .coffeescript .attribute
 {
   color: #ffcc33;
 }
diff --git a/src/styles/dark.css b/src/styles/dark.css
index 102a389..0a00163 100644
--- a/src/styles/dark.css
+++ b/src/styles/dark.css
@@ -54,7 +54,8 @@ pre .envvar,
 pre .apache .tag,
 pre .apache .cbracket,
 pre .tex .command,
-pre .prompt {
+pre .prompt,
+pre .coffeescript .attribute {
   color: #D88;
 }
 
diff --git a/src/styles/default.css b/src/styles/default.css
index e417fc1..1a74220 100644
--- a/src/styles/default.css
+++ b/src/styles/default.css
@@ -26,6 +26,7 @@ pre .tag .value,
 pre .rules .value,
 pre .rules .value .number,
 pre .preprocessor,
+pre .haml .symbol,
 pre .ruby .symbol,
 pre .ruby .symbol .string,
 pre .aggregate,
@@ -41,7 +42,9 @@ pre .apache .cbracket,
 pre .tex .command,
 pre .tex .special,
 pre .erlang_repl .function_or_atom,
-pre .markdown .header {
+pre .asciidoc .header,
+pre .markdown .header,
+pre .coffeescript .attribute {
   color: #800;
 }
 
@@ -50,6 +53,7 @@ pre .annotation,
 pre .template_comment,
 pre .diff .header,
 pre .chunk,
+pre .asciidoc .blockquote,
 pre .markdown .blockquote {
   color: #888;
 }
@@ -58,11 +62,15 @@ pre .number,
 pre .date,
 pre .regexp,
 pre .literal,
+pre .hexcolor,
 pre .smalltalk .symbol,
 pre .smalltalk .char,
 pre .go .constant,
 pre .change,
+pre .lasso .variable,
+pre .asciidoc .bullet,
 pre .markdown .bullet,
+pre .asciidoc .link_url,
 pre .markdown .link_url {
   color: #080;
 }
@@ -78,6 +86,7 @@ pre .attr_selector,
 pre .important,
 pre .pseudo,
 pre .pi,
+pre .haml .bullet,
 pre .doctype,
 pre .deletion,
 pre .envvar,
@@ -87,16 +96,18 @@ pre .nginx .built_in,
 pre .tex .formula,
 pre .erlang_repl .reserved,
 pre .prompt,
+pre .asciidoc .link_label,
 pre .markdown .link_label,
 pre .vhdl .attribute,
 pre .clojure .attribute,
+pre .asciidoc .attribute,
+pre .lasso .attribute,
 pre .coffeescript .property {
   color: #88F
 }
 
 pre .keyword,
 pre .id,
-pre .phpdoc,
 pre .title,
 pre .built_in,
 pre .aggregate,
@@ -110,12 +121,14 @@ pre .bash .variable,
 pre .apache .tag,
 pre .go .typename,
 pre .tex .command,
+pre .asciidoc .strong,
 pre .markdown .strong,
 pre .request,
 pre .status {
   font-weight: bold;
 }
 
+pre .asciidoc .emphasis,
 pre .markdown .emphasis {
   font-style: italic;
 }
@@ -126,6 +139,7 @@ pre .nginx .built_in {
 
 pre .coffeescript .javascript,
 pre .javascript .xml,
+pre .lasso .markup,
 pre .tex .formula,
 pre .xml .javascript,
 pre .xml .vbscript,
diff --git a/src/styles/github.css b/src/styles/docco.css
similarity index 69%
copy from src/styles/github.css
copy to src/styles/docco.css
index 89b02a6..8515996 100644
--- a/src/styles/github.css
+++ b/src/styles/docco.css
@@ -1,12 +1,10 @@
 /*
-
-github.com style (c) Vasily Polovnyov <vast at whiteants.net>
-
+Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)
 */
 
 pre code {
   display: block; padding: 0.5em;
-  color: #333;
+  color: #000;
   background: #f8f8ff
 }
 
@@ -14,51 +12,49 @@ pre .comment,
 pre .template_comment,
 pre .diff .header,
 pre .javadoc {
-  color: #998;
+  color: #408080;
   font-style: italic
 }
 
 pre .keyword,
+pre .assignment,
+pre .literal,
 pre .css .rule .keyword,
 pre .winutils,
 pre .javascript .title,
-pre .nginx .title,
-pre .subst,
-pre .request,
-pre .status {
-  color: #333;
-  font-weight: bold
+pre .lisp .title,
+pre .subst {
+  color: #954121;
 }
 
 pre .number,
-pre .hexcolor,
-pre .ruby .constant {
-  color: #099;
+pre .hexcolor {
+  color: #40a070
 }
 
 pre .string,
 pre .tag .value,
 pre .phpdoc,
 pre .tex .formula {
-  color: #d14
+  color: #219161;
 }
 
 pre .title,
 pre .id {
-  color: #900;
-  font-weight: bold
+  color: #19469D;
+}
+pre .params {
+  color: #00F;
 }
 
 pre .javascript .title,
 pre .lisp .title,
-pre .clojure .title,
 pre .subst {
   font-weight: normal
 }
 
 pre .class .title,
-pre .haskell .type,
-pre .vhdl .literal,
+pre .haskell .label,
 pre .tex .command {
   color: #458;
   font-weight: bold
@@ -74,12 +70,13 @@ pre .django .tag .keyword {
 
 pre .attribute,
 pre .variable,
+pre .instancevar,
 pre .lisp .body {
   color: #008080
 }
 
 pre .regexp {
-  color: #009926
+  color: #B68
 }
 
 pre .class {
@@ -89,15 +86,18 @@ pre .class {
 
 pre .symbol,
 pre .ruby .symbol .string,
+pre .ruby .symbol .keyword,
+pre .ruby .symbol .keymethods,
 pre .lisp .keyword,
 pre .tex .special,
-pre .prompt {
+pre .input_number {
   color: #990073
 }
 
+pre .builtin,
+pre .constructor,
 pre .built_in,
-pre .lisp .title,
-pre .clojure .built_in {
+pre .lisp .title {
   color: #0086b3
 }
 
@@ -125,3 +125,7 @@ pre .diff .change {
 pre .chunk {
   color: #aaa
 }
+
+pre .tex .formula {
+  opacity: 0.5;
+}
diff --git a/src/styles/far.css b/src/styles/far.css
index 54859ca..0b532c1 100644
--- a/src/styles/far.css
+++ b/src/styles/far.css
@@ -32,7 +32,8 @@ pre .addition,
 pre .apache .tag,
 pre .apache .cbracket,
 pre .tex .command,
-pre .clojure .title {
+pre .clojure .title,
+pre .coffeescript .attribute {
   color: #FF0;
 }
 
diff --git a/src/styles/foundation.css b/src/styles/foundation.css
new file mode 100644
index 0000000..d97b47e
--- /dev/null
+++ b/src/styles/foundation.css
@@ -0,0 +1,113 @@
+/*
+Description: Foundation 4 docs style for highlight.js
+Author: Dan Allen <dan.j.allen at gmail.com>
+Website: http://foundation.zurb.com/docs/
+Version: 1.0
+Date: 2013-04-02
+*/
+
+pre code {
+  display: block; padding: 0.5em;
+  background: #eee;
+}
+
+pre .decorator,
+pre .annotation {
+  color: #000077;
+}
+
+pre .attribute {
+  color: #070;
+}
+
+pre .value,
+pre .string,
+pre .scss .value .string {
+  color: #d14;
+}
+
+pre .comment {
+  color: #998;
+  font-style: italic;
+}
+
+pre .function .title {
+  color: #900;
+}
+
+pre .class {
+  color: #458;
+}
+
+pre .id,
+pre .pseudo,
+pre .constant,
+pre .hexcolor {
+  color: teal;
+}
+
+pre .variable {
+  color: #336699;
+}
+
+pre .javadoc {
+  color: #997700;
+}
+
+pre .pi,
+pre .doctype {
+  color: #3344bb;
+}
+
+pre .number {
+  color: #099;
+}
+
+pre .important {
+  color: #f00;
+}
+
+pre .label {
+  color: #970;
+}
+
+pre .preprocessor {
+  color: #579;
+}
+
+pre .reserved,
+pre .keyword,
+pre .scss .value {
+  color: #000;
+}
+
+pre .regexp {
+  background-color: #fff0ff;
+  color: #880088;
+}
+
+pre .symbol {
+  color: #990073;
+}
+
+pre .symbol .string {
+  color: #a60;
+}
+
+pre .tag {
+  color: #007700;
+}
+
+pre .at_rule,
+pre .at_rule .keyword {
+  color: #088;
+}
+
+pre .at_rule .preprocessor {
+  color: #808;
+}
+
+pre .scss .tag,
+pre .scss .attribute {
+  color: #339;
+}
diff --git a/src/styles/github.css b/src/styles/github.css
index 89b02a6..d292d82 100644
--- a/src/styles/github.css
+++ b/src/styles/github.css
@@ -44,7 +44,9 @@ pre .tex .formula {
 }
 
 pre .title,
-pre .id {
+pre .id,
+pre .coffeescript .params,
+pre .scss .preprocessor {
   color: #900;
   font-weight: bold
 }
diff --git a/src/styles/googlecode.css b/src/styles/googlecode.css
index a7b7592..43b1ec6 100644
--- a/src/styles/googlecode.css
+++ b/src/styles/googlecode.css
@@ -43,7 +43,8 @@ pre .filter .argument,
 pre .attr_selector,
 pre .apache .cbracket,
 pre .date,
-pre .regexp {
+pre .regexp,
+pre .coffeescript .attribute {
   color: #080;
 }
 
diff --git a/src/styles/ir_black.css b/src/styles/ir_black.css
index c4c09b5..9168283 100644
--- a/src/styles/ir_black.css
+++ b/src/styles/ir_black.css
@@ -36,7 +36,8 @@ pre .cdata,
 pre .filter .argument,
 pre .attr_selector,
 pre .apache .cbracket,
-pre .date {
+pre .date,
+pre .coffeescript .attribute {
   color: #A8FF60;
 }
 
diff --git a/src/styles/magula.css b/src/styles/magula.css
index 8766344..f72d277 100644
--- a/src/styles/magula.css
+++ b/src/styles/magula.css
@@ -36,7 +36,8 @@ pre .addition,
 pre .flow,
 pre .stream,
 pre .bash .variable,
-pre .apache .cbracket {
+pre .apache .cbracket,
+pre .coffeescript .attribute {
   color: #050;
 }
 
diff --git a/src/styles/mono-blue.css b/src/styles/mono-blue.css
new file mode 100644
index 0000000..7c586eb
--- /dev/null
+++ b/src/styles/mono-blue.css
@@ -0,0 +1,59 @@
+/*
+  Five-color theme from a single blue hue.
+*/
+pre code {
+  display: block; padding: 0.5em;
+  background: #EAEEF3; color: #00193A;
+}
+
+pre .keyword,
+pre .title,
+pre .important,
+pre .request,
+pre .header,
+pre .javadoctag {
+  font-weight: bold;
+}
+
+pre .comment,
+pre .chunk,
+pre .template_comment {
+  color: #738191;
+}
+
+pre .string,
+pre .title,
+pre .parent,
+pre .built_in,
+pre .literal,
+pre .filename,
+pre .value,
+pre .addition,
+pre .tag,
+pre .argument,
+pre .link_label,
+pre .blockquote,
+pre .header {
+  color: #0048AB;
+}
+
+pre .decorator,
+pre .prompt,
+pre .yardoctag,
+pre .subst,
+pre .symbol,
+pre .doctype,
+pre .regexp,
+pre .preprocessor,
+pre .pi,
+pre .attribute,
+pre .attr_selector,
+pre .javadoc,
+pre .xmlDocTag,
+pre .deletion,
+pre .shebang,
+pre .string .variable,
+pre .link_url,
+pre .bullet {
+  color: #4C81C9;
+}
diff --git a/src/styles/monokai.css b/src/styles/monokai.css
index 79c4f6f..c15fd4e 100644
--- a/src/styles/monokai.css
+++ b/src/styles/monokai.css
@@ -11,6 +11,7 @@ pre .tag,
 pre .tag .title,
 pre .keyword,
 pre .literal,
+pre .strong,
 pre .change,
 pre .winutils,
 pre .flow,
@@ -29,10 +30,13 @@ pre code .constant {
 	color: #66D9EF;
 }
 
-pre .class .title {
+pre .code,
+pre .class .title,
+pre .header {
 	color: white;
 }
 
+pre .link_label,
 pre .attribute,
 pre .symbol,
 pre .symbol .string,
@@ -41,10 +45,13 @@ pre .regexp {
 	color: #BF79DB;
 }
 
+pre .link_url,
 pre .tag .value,
 pre .string,
+pre .bullet,
 pre .subst,
 pre .title,
+pre .emphasis,
 pre .haskell .type,
 pre .preprocessor,
 pre .ruby .class .parent,
@@ -71,6 +78,8 @@ pre .prompt {
 
 pre .comment,
 pre .java .annotation,
+pre .blockquote,
+pre .horizontal_rule,
 pre .python .decorator,
 pre .template_comment,
 pre .pi,
@@ -87,6 +96,7 @@ pre .literal,
 pre .css .id,
 pre .phpdoc,
 pre .title,
+pre .header,
 pre .haskell .type,
 pre .vbscript .built_in,
 pre .sql .aggregate,
diff --git a/src/styles/monokai.css b/src/styles/monokai_sublime.css
similarity index 64%
copy from src/styles/monokai.css
copy to src/styles/monokai_sublime.css
index 79c4f6f..d57e8ed 100644
--- a/src/styles/monokai.css
+++ b/src/styles/monokai_sublime.css
@@ -1,114 +1,101 @@
-/*
-Monokai style - ported by Luigi Maselli - http://grigio.org
-*/
-
-pre code {
-  display: block; padding: 0.5em;
-  background: #272822;
-}
-
-pre .tag,
-pre .tag .title,
-pre .keyword,
-pre .literal,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tex .special {
-  color: #F92672;
-}
-
-pre code {
-  color: #DDD;
-}
-
-pre code .constant {
-	color: #66D9EF;
-}
-
-pre .class .title {
-	color: white;
-}
-
-pre .attribute,
-pre .symbol,
-pre .symbol .string,
-pre .value,
-pre .regexp {
-	color: #BF79DB;
-}
-
-pre .tag .value,
-pre .string,
-pre .subst,
-pre .title,
-pre .haskell .type,
-pre .preprocessor,
-pre .ruby .class .parent,
-pre .built_in,
-pre .sql .aggregate,
-pre .django .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .javadoc,
-pre .django .filter .argument,
-pre .smalltalk .localvars,
-pre .smalltalk .array,
-pre .attr_selector,
-pre .pseudo,
-pre .addition,
-pre .stream,
-pre .envvar,
-pre .apache .tag,
-pre .apache .cbracket,
-pre .tex .command,
-pre .prompt {
-  color: #A6E22E;
-}
-
-pre .comment,
-pre .java .annotation,
-pre .python .decorator,
-pre .template_comment,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .shebang,
-pre .apache .sqbracket,
-pre .tex .formula {
-  color: #75715E;
-}
-
-pre .keyword,
-pre .literal,
-pre .css .id,
-pre .phpdoc,
-pre .title,
-pre .haskell .type,
-pre .vbscript .built_in,
-pre .sql .aggregate,
-pre .rsl .built_in,
-pre .smalltalk .class,
-pre .diff .header,
-pre .chunk,
-pre .winutils,
-pre .bash .variable,
-pre .apache .tag,
-pre .tex .special,
-pre .request,
-pre .status {
-  font-weight: bold;
-}
-
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
-  opacity: 0.5;
-}
+/*
+
+Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
+
+*/
+
+pre code {
+  display: block;
+  padding: 0.5em;
+  background: #23241f;
+}
+pre .tag,
+pre code {
+  color: #f8f8f2;
+}
+pre .keyword,
+pre .function,
+pre .literal,
+pre .change,
+pre .winutils,
+pre .flow,
+pre .lisp .title,
+pre .clojure .built_in,
+pre .nginx .title,
+pre .tex .special {
+  color: #66d9ef;
+}
+pre .variable,
+pre .params {
+  color: #fd9720;
+}
+pre .constant {
+  color: #66d9ef;
+}
+pre .title,
+pre .class .title,
+pre .css .class {
+  color: #a6e22e;
+}
+pre .attribute,
+pre .symbol,
+pre .symbol .string,
+pre .tag .title,
+pre .value,
+pre .css .tag {
+  color: #f92672;
+}
+pre .number,
+pre .preprocessor,
+pre .regexp {
+  color: #ae81ff;
+}
+pre .tag .value,
+pre .string,
+pre .css .id,
+pre .subst,
+pre .haskell .type,
+pre .ruby .class .parent,
+pre .built_in,
+pre .sql .aggregate,
+pre .django .template_tag,
+pre .django .variable,
+pre .smalltalk .class,
+pre .django .filter .argument,
+pre .smalltalk .localvars,
+pre .smalltalk .array,
+pre .attr_selector,
+pre .pseudo,
+pre .addition,
+pre .stream,
+pre .envvar,
+pre .apache .tag,
+pre .apache .cbracket,
+pre .tex .command,
+pre .prompt {
+  color: #e6db74;
+}
+pre .comment,
+pre .javadoc,
+pre .java .annotation,
+pre .python .decorator,
+pre .template_comment,
+pre .pi,
+pre .doctype,
+pre .deletion,
+pre .shebang,
+pre .apache .sqbracket,
+pre .tex .formula {
+  color: #75715e;
+}
+pre .coffeescript .javascript,
+pre .javascript .xml,
+pre .tex .formula {
+  opacity: 0.5;
+}
+pre .xml .javascript,
+pre .xml .vbscript,
+pre .xml .css,
+pre .xml .cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/monokai.css b/src/styles/obsidian.css
similarity index 60%
copy from src/styles/monokai.css
copy to src/styles/obsidian.css
index 79c4f6f..7efb0b5 100644
--- a/src/styles/monokai.css
+++ b/src/styles/obsidian.css
@@ -1,14 +1,13 @@
-/*
-Monokai style - ported by Luigi Maselli - http://grigio.org
-*/
+/**
+ * Obsidian style
+ * ported by Alexander Marenin (http://github.com/ioncreature)
+ */
 
 pre code {
-  display: block; padding: 0.5em;
-  background: #272822;
+    display: block; padding: 0.5em;
+    background: #282B2E;
 }
 
-pre .tag,
-pre .tag .title,
 pre .keyword,
 pre .literal,
 pre .change,
@@ -17,34 +16,67 @@ pre .flow,
 pre .lisp .title,
 pre .clojure .built_in,
 pre .nginx .title,
+pre .css .id,
 pre .tex .special {
-  color: #F92672;
+    color: #93C763;
+}
+
+pre .number {
+    color: #FFCD22;
 }
 
 pre code {
-  color: #DDD;
+    color: #E0E2E4;
+}
+
+pre .css .tag,
+pre .css .pseudo {
+    color: #D0D2B5;
 }
 
+pre .attribute,
 pre code .constant {
-	color: #66D9EF;
+    color: #668BB0;
 }
 
-pre .class .title {
-	color: white;
+pre .xml .attribute {
+    color: #B3B689;
+}
+
+pre .xml .tag .value {
+    color: #E8E2B7;
+}
+
+pre .code,
+pre .class .title,
+pre .header {
+    color: white;
+}
+
+pre .class,
+pre .hexcolor {
+    color: #93C763;
 }
 
-pre .attribute,
-pre .symbol,
-pre .symbol .string,
-pre .value,
 pre .regexp {
-	color: #BF79DB;
+    color: #D39745;
+}
+
+pre .at_rule,
+pre .at_rule .keyword {
+    color: #A082BD;
+}
+
+pre .doctype {
+    color: #557182;
 }
 
-pre .tag .value,
-pre .string,
+pre .link_url,
+pre .tag,
+pre .tag .title,
+pre .bullet,
 pre .subst,
-pre .title,
+pre .emphasis,
 pre .haskell .type,
 pre .preprocessor,
 pre .ruby .class .parent,
@@ -66,20 +98,25 @@ pre .apache .tag,
 pre .apache .cbracket,
 pre .tex .command,
 pre .prompt {
-  color: #A6E22E;
+    color: #8CBBAD;
+}
+
+pre .string {
+    color: #EC7600;
 }
 
 pre .comment,
 pre .java .annotation,
+pre .blockquote,
+pre .horizontal_rule,
 pre .python .decorator,
 pre .template_comment,
 pre .pi,
-pre .doctype,
 pre .deletion,
 pre .shebang,
 pre .apache .sqbracket,
 pre .tex .formula {
-  color: #75715E;
+    color: #818E96;
 }
 
 pre .keyword,
@@ -87,6 +124,7 @@ pre .literal,
 pre .css .id,
 pre .phpdoc,
 pre .title,
+pre .header,
 pre .haskell .type,
 pre .vbscript .built_in,
 pre .sql .aggregate,
@@ -99,8 +137,9 @@ pre .bash .variable,
 pre .apache .tag,
 pre .tex .special,
 pre .request,
+pre .at_rule .keyword,
 pre .status {
-  font-weight: bold;
+    font-weight: bold;
 }
 
 pre .coffeescript .javascript,
@@ -110,5 +149,5 @@ pre .xml .javascript,
 pre .xml .vbscript,
 pre .xml .css,
 pre .xml .cdata {
-  opacity: 0.5;
+    opacity: 0.5;
 }
diff --git a/src/styles/sunburst.css b/src/styles/railscasts.css
similarity index 55%
copy from src/styles/sunburst.css
copy to src/styles/railscasts.css
index 28c4ffc..bf55ea1 100644
--- a/src/styles/sunburst.css
+++ b/src/styles/railscasts.css
@@ -1,18 +1,21 @@
 /*
 
-Sunburst-like style (c) Vasily Polovnyov <vast at whiteants.net>
+Railscasts-like style (c) Visoft, Inc. (Damien White)
 
 */
 
 pre code {
-  display: block; padding: 0.5em;
-  background: #000; color: #f8f8f8;
+  display: block;
+  padding: 0.5em;
+  background: #232323;
+  color: #E6E1DC;
 }
 
 pre .comment,
 pre .template_comment,
-pre .javadoc {
-  color: #aeaeae;
+pre .javadoc,
+pre .shebang {
+  color: #BC9458;
   font-style: italic;
 }
 
@@ -20,45 +23,42 @@ pre .keyword,
 pre .ruby .function .keyword,
 pre .request,
 pre .status,
-pre .nginx .title {
-  color: #E28964;
-}
-
-pre .function .keyword,
-pre .sub .keyword,
+pre .nginx .title,
 pre .method,
 pre .list .title {
-  color: #99CF50;
+  color: #C26230;
 }
 
 pre .string,
+pre .number,
+pre .regexp,
 pre .tag .value,
 pre .cdata,
 pre .filter .argument,
 pre .attr_selector,
 pre .apache .cbracket,
 pre .date,
-pre .tex .command {
-  color: #65B042;
+pre .tex .command,
+pre .markdown .link_label {
+  color: #A5C261;
 }
 
 pre .subst {
-  color: #DAEFA3;
-}
-
-pre .regexp {
-  color: #E9C062;
+  color: #519F50;
 }
 
-pre .title,
-pre .sub .identifier,
-pre .pi,
 pre .tag,
 pre .tag .keyword,
-pre .decorator,
-pre .shebang,
-pre .prompt {
-  color: #89BDFF;
+pre .tag .title,
+pre .doctype,
+pre .sub .identifier,
+pre .pi,
+pre .input_number {
+  color: #E8BF6A;
+}
+
+pre .identifier {
+  color: #D0D0FF;
 }
 
 pre .class .title,
@@ -67,19 +67,33 @@ pre .smalltalk .class,
 pre .javadoctag,
 pre .yardoctag,
 pre .phpdoc {
-  text-decoration: underline;
+  text-decoration: none;
 }
 
+pre .constant {
+  color: #DA4939;
+}
+
+
 pre .symbol,
+pre .built_in,
 pre .ruby .symbol .string,
-pre .number {
-  color: #3387CC;
+pre .ruby .symbol .identifier,
+pre .markdown .link_url,
+pre .attribute {
+  color: #6D9CBE;
 }
 
+pre .markdown .link_url {
+  text-decoration: underline;
+}
+
+
+
 pre .params,
 pre .variable,
 pre .clojure .attribute {
-  color: #3E87E3;
+  color: #D0D0FF;
 }
 
 pre .css .tag,
@@ -111,40 +125,49 @@ pre .nginx .built_in {
   color: #9B859D;
 }
 
-pre .preprocessor {
-  color: #8996A8;
+pre .preprocessor,
+pre .preprocessor *{
+  color: #8996A8 !important;
 }
 
 pre .hexcolor,
 pre .css .value .number {
-  color: #DD7B3B;
+  color: #A5C261;
 }
 
+pre .title,
+pre .decorator,
 pre .css .function {
-  color: #DAD085;
+  color: #FFC66D;
 }
 
 pre .diff .header,
-pre .chunk,
-pre .tex .formula {
-  background-color: #0E2231;
-  color: #F8F8F8;
-  font-style: italic;
+pre .chunk {
+  background-color: #2F33AB;
+  color: #E6E1DC;
+  display: inline-block;
+  width: 100%;
 }
 
 pre .diff .change {
   background-color: #4A410D;
   color: #F8F8F8;
+  display: inline-block;
+  width: 100%;
 }
 
 pre .addition {
-  background-color: #253B22;
-  color: #F8F8F8;
+  background-color: #144212;
+  color: #E6E1DC;
+  display: inline-block;
+  width: 100%;
 }
 
 pre .deletion {
-  background-color: #420E09;
-  color: #F8F8F8;
+  background-color: #600;
+  color: #E6E1DC;
+  display: inline-block;
+  width: 100%;
 }
 
 pre .coffeescript .javascript,
@@ -154,5 +177,5 @@ pre .xml .javascript,
 pre .xml .vbscript,
 pre .xml .css,
 pre .xml .cdata {
-  opacity: 0.5;
+  opacity: 0.7;
 }
diff --git a/src/styles/school_book.css b/src/styles/school_book.css
index dd07ed2..3ee9e5f 100644
--- a/src/styles/school_book.css
+++ b/src/styles/school_book.css
@@ -62,7 +62,8 @@ pre .envvar,
 pre .apache .tag,
 pre .apache .cbracket,
 pre .nginx .built_in,
-pre .tex .command {
+pre .tex .command,
+pre .coffeescript .attribute {
   color: #2C009F;
 }
 
diff --git a/src/styles/solarized_dark.css b/src/styles/solarized_dark.css
index 8d3a238..afefba7 100644
--- a/src/styles/solarized_dark.css
+++ b/src/styles/solarized_dark.css
@@ -35,6 +35,7 @@ pre .number,
 pre .command,
 pre .string,
 pre .tag .value,
+pre .rules .value,
 pre .phpdoc,
 pre .tex .formula,
 pre .regexp,
@@ -49,7 +50,8 @@ pre .decorator,
 pre .built_in,
 pre .identifier,
 pre .vhdl .literal,
-pre .id {
+pre .id,
+pre .css .function {
   color: #268bd2;
 }
 
@@ -75,7 +77,8 @@ pre .attr_selector,
 pre .important,
 pre .subst,
 pre .cdata,
-pre .clojure .title {
+pre .clojure .title,
+pre .css .pseudo {
   color: #cb4b16;
 }
 
diff --git a/src/styles/solarized_light.css b/src/styles/solarized_light.css
index a92ecac..dd042a4 100644
--- a/src/styles/solarized_light.css
+++ b/src/styles/solarized_light.css
@@ -35,6 +35,7 @@ pre .number,
 pre .command,
 pre .string,
 pre .tag .value,
+pre .rules .value,
 pre .phpdoc,
 pre .tex .formula,
 pre .regexp,
@@ -49,7 +50,8 @@ pre .decorator,
 pre .built_in,
 pre .identifier,
 pre .vhdl .literal,
-pre .id {
+pre .id,
+pre .css .function {
   color: #268bd2;
 }
 
@@ -75,7 +77,8 @@ pre .attr_selector,
 pre .important,
 pre .subst,
 pre .cdata,
-pre .clojure .title {
+pre .clojure .title,
+pre .css .pseudo {
   color: #cb4b16;
 }
 
diff --git a/src/styles/sunburst.css b/src/styles/sunburst.css
index 28c4ffc..c5d6e1a 100644
--- a/src/styles/sunburst.css
+++ b/src/styles/sunburst.css
@@ -38,7 +38,8 @@ pre .filter .argument,
 pre .attr_selector,
 pre .apache .cbracket,
 pre .date,
-pre .tex .command {
+pre .tex .command,
+pre .coffeescript .attribute {
   color: #65B042;
 }
 
diff --git a/src/styles/tomorrow-night-blue.css b/src/styles/tomorrow-night-blue.css
index 7d2700c..aac64a1 100644
--- a/src/styles/tomorrow-night-blue.css
+++ b/src/styles/tomorrow-night-blue.css
@@ -14,7 +14,7 @@
   color: #ffc58f;
 }
 
-.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
+.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
   color: #ffeead;
 }
 
diff --git a/src/styles/tomorrow-night-bright.css b/src/styles/tomorrow-night-bright.css
index 6dd88e1..5f32b04 100644
--- a/src/styles/tomorrow-night-bright.css
+++ b/src/styles/tomorrow-night-bright.css
@@ -13,7 +13,7 @@
   color: #e78c45;
 }
 
-.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
+.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
   color: #e7c547;
 }
 
diff --git a/src/styles/tomorrow-night-eighties.css b/src/styles/tomorrow-night-eighties.css
index 48011eb..8081687 100644
--- a/src/styles/tomorrow-night-eighties.css
+++ b/src/styles/tomorrow-night-eighties.css
@@ -13,7 +13,7 @@
   color: #f99157;
 }
 
-.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
+.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
   color: #ffcc66;
 }
 
diff --git a/src/styles/tomorrow-night.css b/src/styles/tomorrow-night.css
index cf2c44d..ad2aee5 100644
--- a/src/styles/tomorrow-night.css
+++ b/src/styles/tomorrow-night.css
@@ -14,7 +14,7 @@
   color: #de935f;
 }
 
-.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
+.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
   color: #f0c674;
 }
 
diff --git a/src/styles/tomorrow.css b/src/styles/tomorrow.css
index a2240f2..9f5c1d6 100644
--- a/src/styles/tomorrow.css
+++ b/src/styles/tomorrow.css
@@ -11,7 +11,7 @@
   color: #f5871f;
 }
 
-.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
+.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
   color: #eab700;
 }
 
diff --git a/src/styles/vs.css b/src/styles/vs.css
index 503d698..6760269 100644
--- a/src/styles/vs.css
+++ b/src/styles/vs.css
@@ -5,6 +5,7 @@ Visual Studio-like style based on original C# coloring by Jason Diamond <jason at d
 */
 pre code {
   display: block; padding: 0.5em;
+  background: white; color: black;
 }
 
 pre .comment,
@@ -47,7 +48,8 @@ pre .flow,
 pre .stream,
 pre .apache .tag,
 pre .date,
-pre .tex .formula {
+pre .tex .formula,
+pre .coffeescript .attribute {
   color: rgb(163, 21, 21);
 }
 
diff --git a/src/styles/xcode.css b/src/styles/xcode.css
index 04f7bf9..881ce2f 100644
--- a/src/styles/xcode.css
+++ b/src/styles/xcode.css
@@ -67,7 +67,9 @@ pre .symbol .string,
 pre .number,
 pre .css .function,
 pre .clojure .title,
-pre .clojure .built_in {
+pre .clojure .built_in,
+pre .function .title,
+pre .coffeescript .attribute {
   color: rgb(28,0,207);
 }
 
diff --git a/src/styles/zenburn.css b/src/styles/zenburn.css
index 501d6c7..bc80c43 100644
--- a/src/styles/zenburn.css
+++ b/src/styles/zenburn.css
@@ -89,7 +89,8 @@ pre .css .rules .value,
 pre .attr_selector,
 pre .pseudo,
 pre .apache .cbracket,
-pre .tex .formula {
+pre .tex .formula,
+pre .coffeescript .attribute {
   color: #CC9393;
 }
 
diff --git a/src/test.html b/src/test.html
old mode 100644
new mode 100755
index 4246734..f7bdd6c
--- a/src/test.html
+++ b/src/test.html
@@ -21,6 +21,7 @@
   <link rel="alternate stylesheet" title="Solarized - Light" href="styles/solarized_light.css">
   <link rel="alternate stylesheet" title="Arta" href="styles/arta.css">
   <link rel="alternate stylesheet" title="Monokai" href="styles/monokai.css">
+  <link rel="alternate stylesheet" title="Monokai Sublime" href="styles/monokai_sublime.css">
   <link rel="alternate stylesheet" title="XCode" href="styles/xcode.css">
   <link rel="alternate stylesheet" title="Pojoaque" href="styles/pojoaque.css">
   <link rel="alternate stylesheet" title="Rainbow" href="styles/rainbow.css">
@@ -29,7 +30,11 @@
   <link rel="alternate stylesheet" title="Tomorrow Night Bright" href="styles/tomorrow-night-bright.css">
   <link rel="alternate stylesheet" title="Tomorrow Night Blue" href="styles/tomorrow-night-blue.css">
   <link rel="alternate stylesheet" title="Tomorrow Night Eighties" href="styles/tomorrow-night-eighties.css">
-
+  <link rel="alternate stylesheet" title="Railscasts" href="styles/railscasts.css">
+  <link rel="alternate stylesheet" title="Obsidian" href="styles/obsidian.css">
+  <link rel="alternate stylesheet" title="Docco" href="styles/docco.css">
+  <link rel="alternate stylesheet" title="Mono Blue" href="styles/mono-blue.css">
+  <link rel="alternate stylesheet" title="Foundation" href="styles/foundation.css">
 
   <style>
     body {
@@ -165,7 +170,7 @@
   </script>
 <body>
 
-<p>This is a demo/test page showing all languages supported by <a href="http://softwaremaniacs.org/soft/highlight/en/">highlight.js</a>.
+<p>This is a demo/test page showing all languages supported by <a href="http://highlightjs.org/">highlight.js</a>.
 Most snippets do not contain working code :-).
 
 <div id="styleswitcher">
@@ -219,7 +224,7 @@ module ABC::DEF
   # @return [String] nothing
   def foo(test)
     Thread.new do |blockvar|
-      ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + test)
+      ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + test)
     end.join
   end
 
@@ -233,6 +238,25 @@ render action: :new
 </code></pre>
 
   <tr>
+    <th>Haml
+    <td class="haml">
+    <pre><code>!!! XML
+%html
+  %body
+    %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
+    /html comment
+    -# ignore this line
+    %ul(style='margin: 0')
+    -items.each do |i|
+      %i= i
+    = variable
+    =variable2
+    ~ variable3
+    ~variable4
+    The current year is #{DataTime.now.year}.
+    </code></pre>
+
+  <tr>
     <th>Perl
     <td class="perl">
 <pre><code># loads object
@@ -416,6 +440,53 @@ func main() {
 </body>
 </code></pre>
 
+  <tr>
+    <th>Lasso
+    <td class="lasso">
+<pre><code><?LassoScript
+/* Lasso 8 */
+  local('query' = 'SELECT * FROM `'+var:'table'+'` WHERE `id` > 10
+    ORDER BY `Name` LIMIT 30');
+  Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query;
+    var("class.name" = (found_count != 0 ? `subtotal` | `nonefound`));
+    records;
+      output: ?><tr>[loop_count]</tr><?=;
+    /records;
+  /Inline;
+?><div class="[$class.name]">[found_count]</div>
+[noprocess] causes [delimiters] to be skipped until the next [/noprocess]
+<?lasso
+/* Lasso 9 */
+  define strings_combine(value::string, ...other)::string => {
+    local(result = #value->append(#other->asString))
+    return #result
+  }
+  /**! descriptive text */
+  define person => type {
+    data name::string, protected nickname
+    data birthdate::date
+    data private ssn = null
+    public showName() => return .'name'
+    protected fullName() => '"' + .nickname + '"' + .'name'
+    public ssnListed => .ssn ? true | false
+  }
+  define person->name=(value) => {
+    .'name' = #value
+    return self->'name'
+  }
+  // query expression
+  with n in array(-1, 0xABCD, 3.14159e14)
+  let swapped = pair(#n->second, #n->first)
+  group #swapped by #n->first into t
+  let key = #t->key
+  order by #key
+  select pair(#key, #t)
+  do {^
+    #n->upperCase
+  ^}
+?>
+</code></pre>
+
 	<tr>
 		<th>Markdown
 		<td class="markdown">
@@ -442,6 +513,74 @@ hello world
 2. two thing `i can write code`, and `more` wipee!
 </code></pre>
 
+	<tr>
+		<th>AsciiDoc
+		<td class="asciidoc">
+<pre>
+<code>Hello, World!
+============
+Author Name, <author at domain.foo>
+
+you can write text http://example.com[with links], optionally
+using an explicit link:http://example.com[link prefix].
+
+* single quotes around a phrase place 'emphasis'
+** alternatively, you can put underlines around a phrase to add _emphasis_
+* astericks around a phrase make the text *bold*
+* pluses around a phrase make it +monospaced+
+
+- escape characters are supported
+- you can escape a quote inside emphasized text like 'here\'s johnny!'
+
+term:: definition
+ another term:: another definition
+
+// this is just a comment
+
+Let's make a break.
+
+'''
+
+////
+we'll be right with you
+
+after this brief interruption.
+////
+
+== We're back!
+
+Want to see a image::images/tiger.png[Tiger]?
+
+.Nested highlighting
+++++
+<this_is inline="xml"></this_is>
+++++
+
+____
+asciidoc is so powerful.
+____
+
+another quote:
+
+[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
+____
+When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
+____
+
+Getting Literal
+---------------
+
+ want to get literal? prefix a line with a space.
+
+....
+I'll join that party, too.
+....
+
+. one thing (yeah!)
+. two thing `i can write code`, and `more` wipee!
+
+NOTE: AsciiDoc is quite cool, you should try it.</code></pre>
+
   <tr>
     <th>Django templates
     <td class="django">
@@ -464,12 +603,28 @@ multiline.
 </code></pre>
 
   <tr>
+    <th>Handlebars
+    <td class="handlebars">
+<pre>
+<code><h3>Hours</h3>
+
+<ul>
+  {{#each content.users}}
+  <li {{bindAttr hello="world"}}>{{firstName}}</li>
+  {{/each}}
+</ul>
+</code></pre>
+
+  <tr>
     <th>CSS
     <td class="css">
 <pre><code>@media screen and (-webkit-min-device-pixel-ratio: 0) {
   body:first-of-type pre::after {
     content: 'highlight: ' attr(class);
   }
+  body {
+    background: linear-gradient(45deg, blue, red);
+  }
 }
 
 @import url('print.css');
@@ -491,6 +646,83 @@ li[lang=ru] {
 </code></pre>
 
   <tr>
+    <th>SCSS
+    <td class="scss">
+<pre><code>@import "compass/reset";
+
+// variables
+$colorGreen: #008000;
+$colorGreenDark: darken($colorGreen, 10);
+
+ at mixin container {
+    max-width: 980px;
+}
+
+// mixins with parameters
+ at mixin button($color:green) {
+    @if ($color == green) {
+        background-color: #008000;
+    }
+    @else if ($color == red) {
+        background-color: #B22222;
+    }
+}
+
+button {
+    @include button(red);
+}
+
+div,
+.navbar,
+#header,
+input[type="input"] {
+    font-family: "Helvetica Neue", Arial, sans-serif;
+    width: auto;
+    margin: 0 auto;
+    display: block;
+}
+
+.row-12 > [class*="spans"] {
+    border-left: 1px solid #B5C583;
+}
+
+// nested definitions
+ul {
+    width: 100%;
+    padding: {
+        left: 5px; right: 5px;
+    }
+  li {
+      float: left; margin-right: 10px;
+      .home {
+          background: url('http://placehold.it/20') scroll no-repeat 0 0;
+    }
+  }
+}
+
+.banner {
+    @extend .container;
+}
+
+a {
+  color: $colorGreen;
+  &:hover { color: $colorGreenDark; }
+  &:visited { color: #c458cb; }
+}
+
+ at for $i from 1 through 5 {
+    .span#{$i} {
+        width: 20px*$i;
+    }
+}
+
+ at mixin mobile {
+  @media screen and (max-width : 600px) {
+    @content;
+  }
+}</code></pre>
+
+  <tr>
     <th>JSON
     <td class="json">
 <pre><code>[
@@ -523,14 +755,28 @@ li[lang=ru] {
   }
   for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
     if (checkCondition(classes[i]) === undefined)
-      return /\d+/g;
+      return /\d+[\s/]/g;
   }
 }</code></pre>
 
   <tr>
     <th>CoffeeScript
     <td class="coffeescript">
-<pre><code>grade = (student) ->
+<pre><code># Divisions
+x = 6/foo/i
+x = 6 /foo
+x = 6 / foo
+x = 6 /foo * 2/gm
+x = f /foo
+x = f / foo / gm
+x = f /foo * 2/6
+
+# Regexps
+x = f /6 * 2/ - 3
+x = f /foo * 2/gm
+x = if true then /\n/ else /[.,]+/
+
+grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
   if student.excellentWork
     "A+"
   else if student.okayStuff
@@ -538,8 +784,6 @@ li[lang=ru] {
   else
     "C"
 
-eldest = if 24 > 21 then "Liz" else "Ike"
-
 square = (x) -> x * x
 
 two = -> 2
@@ -563,7 +807,7 @@ hi = `function() {
 }`
 
 heredoc = """
-CoffeeScript numbers test #{ 010 + 0xf / 0b10 }
+CoffeeScript subst test #{ 010 + 0xf / 0b10 + "nested string #{ /\n/ }"}
 """
 
 ###
@@ -573,12 +817,6 @@ Released under the MIT License
 
 OPERATOR = /// ^ (
 ?: [-=]>             # function
- | [-+*/%<>&|^!?=]=  # compound assign / compare
- | >>>=?             # zero-fill right shift
- | ([-+:])\1         # doubles
- | ([&|<>])\2=?      # logic / shift
- | \?\.              # soak access
- | \.{2,3}           # range or splat
 ) ///</code></pre>
 
 <tr>
@@ -643,6 +881,53 @@ for i = 0 to ubound(ini_strings)
 next</code></pre>
 
   <tr>
+    <th>VB.NET
+    <td class="vbnet">
+<pre><code>Import System
+Import System.IO
+#Const DEBUG = True
+
+Namespace Highlighter.Test
+  ''' <summary>This is an example class.</summary>
+  Public Class Program
+    Protected Shared hello As Integer = 3
+    Private Const ABC As Boolean = False
+
+#Region "Code"
+    ' Cheers!
+    <STAThread()> _
+    Public Shared Sub Main(ByVal args() As String, ParamArray arr As Object) Handles Form1.Click
+      On Error Resume Next
+      If ABC Then
+        While ABC : Console.WriteLine() : End While
+        For i As Long = 0 To 1000 Step 123
+          Try
+            System.Windows.Forms.MessageBox.Show(CInt("1").ToString())
+          Catch ex As Exception       ' What are you doing? Well...
+            Dim exp = CType(ex, IOException)
+            REM ORZ
+            Return
+          End Try
+        Next
+      Else
+        Dim l As New System.Collections.List<String>()
+        SyncLock l
+          If TypeOf l Is Decimal And l IsNot Nothing Then
+            RemoveHandler button1.Paint, delegate
+          End If
+          Dim d = New System.Threading.Thread(AddressOf ThreadProc)
+          Dim a = New Action(Sub(x, y) x + y)
+          Static u = From x As String In l Select x.Substring(2, 4) Where x.Length > 0
+        End SyncLock
+        Do : Laugh() : Loop Until hello = 4
+      End If
+    End Sub
+#End Region
+  End Class
+End Namespace
+</code></pre>
+
+  <tr>
     <th>HTTP
     <td class="http">
 <pre><code>POST /task?id=1 HTTP/1.1
@@ -675,7 +960,7 @@ end
 
 -- Signal test
 local signal = create_signal()
-signal:register(function (signal, ...)
+signal:register(function(signal, ...)
     print(...)
 end)
 signal:emit('Answer to Life, the Universe, and Everything:', 42)
@@ -747,7 +1032,11 @@ End;{CopyFile}
   <tr>
     <th>Java
     <td class="java">
-<pre><code>package l2f.gameserver.model;
+<pre><code>/**
+ * @author John Smith <john.smith at example.com>
+ * @version 1.0
+*/
+package l2f.gameserver.model;
 
 import java.util.ArrayList;
 
@@ -861,7 +1150,7 @@ namespace Test {
 }
 
 /* defining a class */
-class Track : GLib.Object {              /* subclassing 'GLib.Object' */
+class Track : GLib.Object, Test.Foo {              /* subclassing 'GLib.Object' */
   public double mass;                  /* a public field */
   public double name { get; set; }     /* a public property */
   private bool terminated = false;     /* a private field */
@@ -918,6 +1207,67 @@ lines!";
         return 0;
     }
 }
+
+async Task<int> AccessTheWebAsync()
+{
+    // ...
+    string urlContents = await getStringTask;
+    return urlContents.Length;
+}
+</code></pre>
+
+  <tr>
+    <th>F#
+    <td class="fsharp">
+<pre><code>open System
+
+// Single line comment...
+(*
+  This is a
+  multiline comment.
+*)
+let checkList alist =
+    match alist with
+    | [] -> 0
+    | [a] -> 1
+    | [a; b] -> 2
+    | [a; b; c] -> 3
+    | _ -> failwith "List is too big!"
+
+
+type IEncoding =
+    abstract Encode : string -> string
+    abstract Decode : string -> string
+
+let text = "Some text..."
+let text2 = @"A ""verbatim"" string..."
+let catalog = """
+Some "long" string...
+"""
+
+let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
+
+let fibs =
+    Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
+    |> Async.RunSynchronously
+
+type Sprocket(gears) =
+  member this.Gears : int = gears
+
+[<AbstractClass>]
+type Animal =
+  abstract Speak : unit -> unit
+
+type Widget =
+  | RedWidget
+  | GreenWidget
+
+type Point = {X: float; Y: float;}
+
+[<Measure>]
+type s
+let minutte = 60<s>
+
 </code></pre>
 
 <tr>
@@ -1071,7 +1421,7 @@ layout(triangles) in;
 layout(triangle_strip, max_vertices = 3) out;
 
 void main() {
-  for(int i = 0; i < gl_in.length(); i++) {
+  for(int i = 0; i < gl_in.length(); i++) {
     gl_Position = gl_in[i].gl_Position;
     EmitVertex();
   }
@@ -1157,7 +1507,9 @@ heapExample
   <tr>
     <th>Lisp
     <td class="lisp">
-<pre><code>(defun prompt-for-cd ()
+<pre><code>#!/usr/bin/env csi
+
+(defun prompt-for-cd ()
    "Prompts
     for CD"
    (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
@@ -1192,11 +1544,11 @@ heapExample
 (def
   ^{:macro true
     :added "1.0"}
-  let (fn* let [&form &env & decl] (cons 'let* decl)))
+  let (fn* let [&form &env & decl] (cons 'let* decl)))
 
 (def
 
- defn (fn defn [&form &env name & fdecl]
+ defn (fn defn [&form &env name & fdecl]
         (let [m (conj {:arglists (list 'quote (sigs fdecl))} m)
               m (let [inline (:inline m)
                       ifn (first inline)
@@ -1401,7 +1753,7 @@ genApacheConf(){
  else
   full_domain=$2.$1
  fi
- host_root="${APACHE_HOME_DIR}$1/$2"
+ host_root="${APACHE_HOME_DIR}$1/$2/$(title)"
  echo -e "# Host $1/$2 :"
 }
 </code></pre>
@@ -1472,6 +1824,47 @@ public boolean unpack(container packedClass) {
 }
 </code></pre>
 
+<tr>
+  <th>Oracle Rules Language
+  <td class="ruleslanguage">
+<pre><code>//This is a comment
+ABORT "You experienced an abort.";
+WARN "THIS IS A WARNING";
+CALL "RIDER_X";
+DONE;
+FOR EACH X IN CSV_FILE "d:\lodestar\user\d377.lse"
+ LEAVE FOR;
+END FOR;
+IF ((BILL_KW = 0) AND (KW > 0)) THEN
+END IF;
+INCLUDE "R1";
+LEAVE RIDER;
+SELECT BILL_PERIOD
+   WHEN "WINTER"
+      BLOCK KWH
+      FROM 0 TO 400 CHARGE $0.03709
+      FROM 400 CHARGE $0.03000
+      TOTAL $ENERGY_CHARGE_WIN;
+   WHEN "SUMMER"
+      $VOLTAGE_DISCOUNT_SUM = $0.00
+   OTHERWISE
+      $VOLTAGE_DISCOUNT_SUM = $1.00
+END SELECT;
+/* Report top five peaks */
+LABEL PK.NM "Peak Number";
+SAVE_UPDATE MV TO TABLE "METERVALUE";
+
+FOR EACH INX IN ARRAYUPPERBOUND(#MYARRAY[])
+  #MYARRAY[INX].VALUE = 2;
+  CLEAR #MYARRAY[];
+END FOR
+
+//Interval Data
+HNDL_1_ADD_EDI = INTDADDATTRIBUTE(HNDL_1, "EDI_TRANSACTION", EDI_ID);
+HNDL_1_ADD_VAL_MSG = INTDADDVMSG(HNDL_1,"Missing (Status Code 9) values found");
+EMPTY_HNDL = INTDCREATEHANDLE('05/03/2006 00:00:00', '05/03/2006 23:59:59', 3600, "Y", "0", " ");
+</code></pre>
+
   <tr>
     <th>1С
     <td class="1c">
@@ -1631,21 +2024,22 @@ $$
     <td class="brainfuck">
 <pre><code>++++++++++
 [ 3*10 and 10*10
-  ->+++>++++++++++<<
-]>>
+  ->+++>++++++++++<<
+]>>
 [ filling cells
-  ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[<]<[<]<[<]>>
-]<
-+++++++++<<
+  ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[<]<[<]<[<]>>
+]<
++++++++++<<
 [ rough codes correction loop
-  ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]<
+  ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]<
 ]
 more accurate сodes correction
->>>++>
--->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++>
-++>+++++++++++>++++++++++++>------>+++
+>>>++>
+-->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++>
+++>+++++++++++>++++++++++++>------>+++
 rewind and output
-[<]>[.>]</code></pre>
+[<]>[.>]
+</code></pre>
 
   <tr>
     <th>Haskell
@@ -1672,8 +2066,8 @@ import Network.Socket.ByteString (sendTo, recv, recvFrom)
 
 -- Type class for converting StringLike types to and from strict ByteStrings
 class DataPacket a where
-  toStrictBS :: a -> Strict.ByteString
-  fromStrictBS :: Strict.ByteString -> a
+  toStrictBS :: a -> Strict.ByteString
+  fromStrictBS :: Strict.ByteString -> a
 
 instance DataPacket Strict.ByteString where
   toStrictBS = id
@@ -1681,16 +2075,16 @@ instance DataPacket Strict.ByteString where
   fromStrictBS = id
   {-# INLINE fromStrictBS #-}
 
-openBoundUDPPort :: String -> Int -> IO Socket
+openBoundUDPPort :: String -> Int -> IO Socket
 openBoundUDPPort uri port = do
-  s <- getUDPSocket
-  bindAddr <- inet_addr uri
+  s <- getUDPSocket
+  bindAddr <- inet_addr uri
   let a = SockAddrInet (toEnum port) bindAddr
   bindSocket s a
   return s
 
-pingUDPPort :: Socket -> SockAddr -> IO ()
-pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
+pingUDPPort :: Socket -> SockAddr -> IO ()
+pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
 </code></pre>
 
   <tr>
@@ -1710,36 +2104,36 @@ pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
     channel
    }).
 
-test(Foo)->Foo.
+test(Foo)->Foo.
 
-init([Shell, Exec]) ->
+init([Shell, Exec]) ->
     {ok, #state{shell = Shell, exec = Exec}};
-init([Shell]) ->
+init([Shell]) ->
     false = not true,
     io:format("Hello, \"~p!~n", [atom_to_list('World')]),
     {ok, #state{shell = Shell}}.
 
-concat([Single]) -> Single;
-concat(RList) ->
+concat([Single]) -> Single;
+concat(RList) ->
     EpsilonFree = lists:filter(
-        fun (Element) ->
+        fun (Element) ->
             case Element of
-                epsilon -> false;
-                _ -> true
+                epsilon -> false;
+                _ -> true
             end
         end,
         RList),
     case EpsilonFree of
-        [Single] -> Single;
-        Other -> {concat, Other}
+        [Single] -> Single;
+        Other -> {concat, Other}
     end.
 
-union_dot_union({union, _}=U1, {union, _}=U2) ->
+union_dot_union({union, _}=U1, {union, _}=U2) ->
     union(lists:flatten(
         lists:map(
-            fun (X1) ->
+            fun (X1) ->
                 lists:map(
-                    fun (X2) ->
+                    fun (X2) ->
                         concat([X1, X2])
                     end,
                     union_to_list(U2)
@@ -1752,32 +2146,32 @@ union_dot_union({union, _}=U1, {union, _}=U2) ->
   <tr>
     <th>Erlang REPL
     <td class="erlang-repl">
-<pre><code>1> Str = "abcd".
+<pre><code>1> Str = "abcd".
 "abcd"
-2> L = test:length(Str).
+2> L = test:length(Str).
 4
-3> Descriptor = {L, list_to_atom(Str)}.
+3> Descriptor = {L, list_to_atom(Str)}.
 {4,abcd}
-4> L.
+4> L.
 4
-5> b().
+5> b().
 Descriptor = {4,abcd}
 L = 4
 Str = "abcd"
 ok
-6> f(L).
+6> f(L).
 ok
-7> b().
+7> b().
 Descriptor = {4,abcd}
 Str = "abcd"
 ok
-8> {L, _} = Descriptor.
+8> {L, _} = Descriptor.
 {4,abcd}
-9> L.
+9> L.
 4
-10> 2#101.
+10> 2#101.
 5
-11> 1.85e+3.
+11> 1.85e+3.
 1850
 </code></pre>
 
@@ -1803,7 +2197,7 @@ export fac, test1;
 12E+99_f64;                        // type f64
 
 /* Factorial */
-fn fac(n: int) -> int {
+fn fac(n: int) -> int {
     let s: str = "This is
 a multi-line string.
 
@@ -1811,39 +2205,39 @@ It ends with an unescaped '\"'.";
     let c: char = 'Ф';
 
     let result = 1, i = 1;
-    while i <= n { // No parens around the condition
+    while i <= n { // No parens around the condition
         result *= i;
         i += 1;
     }
     ret result;
 }
 
-pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
+pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
 
-type t = map::hashtbl<int,str>;
-let x = id::<int>(10);
+type t = map::hashtbl<int,str>;
+let x = id::<int>(10);
 
 // Define some modules.
 #[path = "foo.rs"]
 mod foo;
 
-iface seq<T> {
-    fn len() -> uint;
+iface seq<T> {
+    fn len() -> uint;
 }
 
-impl <T> of seq<T> for [T] {
-    fn len() -> uint { vec::len(self) }
+impl <T> of seq<T> for [T] {
+    fn len() -> uint { vec::len(self) }
     fn iter(b: fn(T)) {
         for elt in self { b(elt); }
     }
 }
 
-enum list<T> {
+enum list<T> {
     nil;
-    cons(T, @list<T>);
+    cons(T, @list<T>);
 }
 
-let a: list<int> = cons(7, @cons(13, @nil));
+let a: list<int> = cons(7, @cons(13, @nil));
 </code></pre>
 
   <tr>
@@ -1858,7 +2252,7 @@ plot(points(:,1),points(:,2));
 for i = 1: n-1
     len(i) = points(i + 1, 1) - points(i, 1);
 end
-while(max(len) > 2 * min(len))
+while(max(len) > 2 * min(len))
     [d, i] = max(len);
     k = on_margin(points, i, d, -1);
     m = on_margin(points, i + 1, d, 1);
@@ -1894,7 +2288,7 @@ foo_cell = {1, 2, 3; 4, 5, 6}''.'.';
     <td class="r">
 <pre><code>library(ggplot2)
 
-centre <- function(x, type, ...) {
+centre <- function(x, type, ...) {
   switch(type,
          mean = mean(x),
          median = median(x),
@@ -1923,8 +2317,8 @@ foo "bar" baz
 1L + 30
 plot(cars, xlim=20)
 plot(cars, xlim=0x20)
-foo<-30
-my.data.3 <- read() # not a number
+foo<-30
+my.data.3 <- read() # not a number
 c(1,2,3)
 1%%2
 
@@ -1953,8 +2347,8 @@ na_character_ na_complex_ Function While Repeat
 For If In Else Next Break .. .... "NULL" `NULL` 'NULL'
 
 # operators
-+, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
-->, <-, <<-, $, :, ::
++, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
+->, <-, <<-, $, :, ::
 
 # infix operator
 foo %union% bar
@@ -1964,6 +2358,96 @@ foo %union% bar
 </code></pre>
 
 
+  <tr>
+    <th>Mizar
+    <td class="mizar">
+<pre><code>::: ## Lambda calculus
+
+environ
+
+  vocabularies LAMBDA,
+      NUMBERS,
+      NAT_1, XBOOLE_0, SUBSET_1, FINSEQ_1, XXREAL_0, CARD_1,
+      ARYTM_1, ARYTM_3, TARSKI, RELAT_1, ORDINAL4, FUNCOP_1;
+
+  :: etc...
+
+begin
+
+reserve D for DecoratedTree,
+        p,q,r for FinSequence of NAT,
+        x for set;
+
+definition
+  let D;
+
+  attr D is LambdaTerm-like means
+    (dom D qua Tree) is finite &
+::>                          *143,306
+    for r st r in dom D holds
+      r is FinSequence of {0,1} &
+      r^<*0*> in dom D implies D.r = 0;
+end;
+
+registration
+  cluster LambdaTerm-like for DecoratedTree of NAT;
+  existence;
+::>       *4
+end;
+
+definition
+  mode LambdaTerm is LambdaTerm-like DecoratedTree of NAT;
+end;
+
+::: Then we extend this ordinary one-step beta reduction, that is,
+:::  any subterm is also allowed to reduce.
+definition
+  let M,N;
+
+  pred M beta N means
+    ex p st
+      M|p beta_shallow N|p &
+      for q st not p is_a_prefix_of q holds
+        [r,x] in M iff [r,x] in N;
+end;
+
+theorem Th4:
+  ProperPrefixes (v^<*x*>) = ProperPrefixes v \/ {v}
+proof
+  thus ProperPrefixes (v^<*x*>) c= ProperPrefixes v \/ {v}
+  proof
+    let y;
+    assume y in ProperPrefixes (v^<*x*>);
+    then consider v1 such that
+A1: y = v1 and
+A2: v1 is_a_proper_prefix_of v^<*x*> by TREES_1:def 2;
+ v1 is_a_prefix_of v & v1 <> v or v1 = v by A2,TREES_1:9;
+then
+ v1 is_a_proper_prefix_of v or v1 in {v} by TARSKI:def 1,XBOOLE_0:def 8;
+then  y in ProperPrefixes v or y in {v} by A1,TREES_1:def 2;
+    hence thesis by XBOOLE_0:def 3;
+  end;
+  let y;
+  assume y in ProperPrefixes v \/ {v};
+then A3: y in ProperPrefixes v or y in {v} by XBOOLE_0:def 3;
+A4: now
+    assume y in ProperPrefixes v;
+    then consider v1 such that
+A5: y = v1 and
+A6: v1 is_a_proper_prefix_of v by TREES_1:def 2;
+ v is_a_prefix_of v^<*x*> by TREES_1:1;
+then  v1 is_a_proper_prefix_of v^<*x*> by A6,XBOOLE_1:58;
+    hence thesis by A5,TREES_1:def 2;
+  end;
+ v^{} = v by FINSEQ_1:34;
+  then
+ v is_a_prefix_of v^<*x*> & v <> v^<*x*> by FINSEQ_1:33,TREES_1:1;
+then  v is_a_proper_prefix_of v^<*x*> by XBOOLE_0:def 8;
+then  y in ProperPrefixes v or y = v & v in ProperPrefixes (v^<*x*>)
+  by A3,TARSKI:def 1,TREES_1:def 2;
+  hence thesis by A4;
+end;</code></pre>
+
 </table>
 
 <script>
diff --git a/tools/build.py b/tools/build.py
index b711fad..33aa565 100644
--- a/tools/build.py
+++ b/tools/build.py
@@ -6,9 +6,8 @@ pre-packed modules.
 
 import os
 import shutil
-import sys
 import re
-import optparse
+import argparse
 import subprocess
 import json
 from functools import partial
@@ -65,7 +64,7 @@ def lang_name(filename):
 def mapnonstrings(source, func):
     result = []
     pos = 0
-    quotes = re.compile('[\'"]')
+    quotes = re.compile('[\'"/]')
     while pos < len(source):
         match = quotes.search(source, pos)
         end = match.start() if match else len(source)
@@ -95,18 +94,19 @@ def compress_content(tools_path, content, filetype='js'):
 
     args = ['java', '-jar', os.path.join(tools_path, 'yuicompressor.jar'), '--type', filetype]
     p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-    p.stdin.write(content)
+    p.stdin.write(content.encode('utf-8'))
     p.stdin.close()
-    content = p.stdout.read()
+    content = p.stdout.read().decode('utf-8')
     p.stdout.close()
 
     return content
 
-def parse_header(content):
+def parse_header(filename):
     '''
     Parses possible language description header from a file. If a header is found returns it
     as dict, otherwise returns None.
     '''
+    content = open(filename, encoding='utf-8').read(1024)
     match = re.search(r'^\s*/\*(.*?)\*/', content, re.S)
     if not match:
         return
@@ -119,19 +119,16 @@ def language_filenames(src_path, languages):
     Resolves dependencies and returns the list of actual language filenames
     '''
     lang_path = os.path.join(src_path, 'languages')
-    filenames = os.listdir(lang_path)
-    infos = [
-        (parse_header(open(os.path.join(lang_path, f)).read(1024)), f)
-        for f in filenames
-    ]
-    infos = [(i, f) for i, f in infos if i]
+    filenames = [f for f in os.listdir(lang_path) if f.endswith('.js')]
+    headers = [parse_header(os.path.join(lang_path, f)) for f in filenames]
+    infos = [(h, f) for h, f in zip(headers, filenames) if h]
 
     # Filtering infos based on list of languages and categories
     if languages:
-        categories = set(l for l in languages if l.startswith(':'))
+        categories = {l for l in languages if l.startswith(':')}
         languages = set(languages) - categories
-        categories = set(c.strip(':') for c in categories)
-        cat_languages = set(l for c, ls in CATEGORIES.items() if c in categories for l in ls)
+        categories = {c.strip(':') for c in categories}
+        cat_languages = {l for c, ls in CATEGORIES.items() if c in categories for l in ls}
         languages |= cat_languages
         infos = [
             (i, f) for i, f in infos
@@ -152,7 +149,7 @@ def language_filenames(src_path, languages):
     return [os.path.join(lang_path, f) for f in filenames]
 
 def strip_read(filename):
-    s = open(filename).read()
+    s = open(filename, encoding='utf-8').read()
     pattern = re.compile(r'^\s*(/\*(.*?)\*/)?\s*', re.DOTALL)
     s = pattern.sub('', s)
     return s.strip()
@@ -183,7 +180,7 @@ def glue_files(hljs_filename, language_filenames, compressed):
     '''
     if compressed:
         hljs = 'var hljs=new %s();' % strip_read(hljs_filename).rstrip(';')
-        file_func = lambda f: open(f).read()
+        file_func = lambda f: open(f, encoding='utf-8').read()
     else:
         hljs = 'var hljs = new %s();\n' % strip_read(hljs_filename)
         file_func = strip_read
@@ -192,14 +189,14 @@ def glue_files(hljs_filename, language_filenames, compressed):
 def build_browser(root, build_path, filenames, options):
     src_path = os.path.join(root, 'src')
     tools_path = os.path.join(root, 'tools')
-    print 'Building %d files:\n%s' % (len(filenames), '\n'.join(filenames))
+    print('Building %d files:\n%s' % (len(filenames), '\n'.join(filenames)))
     content = glue_files(os.path.join(src_path, 'highlight.js'), filenames, False)
-    print 'Uncompressed size:', len(content)
+    print('Uncompressed size:', len(content.encode('utf-8')))
     if options.compress:
-        print 'Compressing...'
+        print('Compressing...')
         content = compress_content(tools_path, content)
-        print 'Compressed size:', len(content)
-    open(os.path.join(build_path, 'highlight.pack.js'), 'w').write(content)
+        print('Compressed size:', len(content.encode('utf-8')))
+    open(os.path.join(build_path, 'highlight.pack.js'), 'w', encoding='utf-8').write(content)
 
 def build_amd(root, build_path, filenames, options):
     src_path = os.path.join(root, 'src')
@@ -207,99 +204,95 @@ def build_amd(root, build_path, filenames, options):
     print('Building %d files:\n%s' % (len(filenames), '\n'.join(filenames)))
     content = glue_files(os.path.join(src_path, 'highlight.js'), filenames, False)
     content = 'define(function() {\n%s\nreturn hljs;\n});' % content # AMD wrap
-    print 'Uncompressed size:', len(content)
+    print('Uncompressed size:', len(content.encode('utf-8')))
     if options.compress:
-        print 'Compressing...'
+        print('Compressing...')
         content = compress_content(tools_path, content)
-        print 'Compressed size:', len(content)
-    open(os.path.join(build_path, 'highlight.pack.js'), 'w').write(content)
+        print('Compressed size:', len(content.encode('utf-8')))
+    open(os.path.join(build_path, 'highlight.pack.js'), 'w', encoding='utf-8').write(content)
 
 def build_node(root, build_path, filenames, options):
     src_path = os.path.join(root, 'src')
-    print 'Building %d files:' % len(filenames)
+    print('Building %d files:' % len(filenames))
     for filename in filenames:
-        print filename
+        print(filename)
         content = 'module.exports = %s;' % strip_read(filename)
-        open(os.path.join(build_path, os.path.basename(filename)), 'w').write(content)
+        open(os.path.join(build_path, os.path.basename(filename)), 'w', encoding='utf-8').write(content)
     filename = os.path.join(src_path, 'highlight.js')
-    print filename
+    print(filename)
 
-    print 'Registering languages with the library...'
+    print('Registering languages with the library...')
     hljs = 'var hljs = new %s();' % strip_read(filename)
     filenames = map(os.path.basename, filenames)
     for filename in filenames:
         hljs += '\nhljs.LANGUAGES[\'%s\'] = require(\'./%s\')(hljs);' % (lang_name(filename), filename)
     hljs += '\nmodule.exports = hljs;'
-    open(os.path.join(build_path, 'highlight.js'), 'w').write(hljs)
+    open(os.path.join(build_path, 'highlight.js'), 'w', encoding='utf-8').write(hljs)
     if options.compress:
-        print 'Notice: not compressing files for "node" target.'
+        print('Notice: not compressing files for "node" target.')
 
-    print 'Adding package.json...'
-    package = json.load(open(os.path.join(src_path, 'package.json')))
-    authors = open(os.path.join(root, 'AUTHORS.en.txt'))
+    print('Adding package.json...')
+    package = json.load(open(os.path.join(src_path, 'package.json'), encoding='utf-8'))
+    authors = open(os.path.join(root, 'AUTHORS.en.txt'), encoding='utf-8')
     matches = (re.match('^- (?P<name>.*) <(?P<email>.*)>$', a) for a in authors)
     package['contributors'] = [m.groupdict() for m in matches if m]
     content = json.dumps(package, indent=2)
-    open(os.path.join(build_path, 'package.json'), 'w').write(content)
+    open(os.path.join(build_path, 'package.json'), 'w', encoding='utf-8').write(content)
 
 def build_cdn(root, build_path, filenames, options):
     src_path = os.path.join(root, 'src')
     tools_path = os.path.join(root, 'tools')
     if not options.compress:
-        print 'Notice: forcing compression for "cdn" target'
+        print('Notice: forcing compression for "cdn" target')
         options.compress = True
     build_browser(root, build_path, filenames, options)
     os.rename(os.path.join(build_path, 'highlight.pack.js'), os.path.join(build_path, 'highlight.min.js'))
-    print 'Compressing all languages...'
+    print('Compressing all languages...')
     lang_path = os.path.join(build_path, 'languages')
     os.mkdir(lang_path)
     all_filenames = language_filenames(src_path, [])
     for filename in all_filenames:
-        print filename
-        content = compress_content(tools_path, open(filename).read())
+        print(filename)
+        content = compress_content(tools_path, strip_read(filename))
         content = wrap_language(filename, content, True)
-        open(os.path.join(lang_path, '%s.min.js' % lang_name(filename)), 'w').write(content)
-    print 'Compressing styles...'
+        open(os.path.join(lang_path, '%s.min.js' % lang_name(filename)), 'w', encoding='utf-8').write(content)
+    print('Compressing styles...')
     build_style_path = os.path.join(build_path, 'styles')
     src_style_path = os.path.join(src_path, 'styles')
     os.mkdir(build_style_path)
     styles = [lang_name(f) for f in os.listdir(src_style_path) if f.endswith('.css')]
     for style in styles:
         filename = os.path.join(src_style_path, '%s.css' % style)
-        print filename
+        print(filename)
         content = compress_content(tools_path, open(filename).read(), 'css')
-        open(os.path.join(build_style_path, '%s.min.css' % style), 'w').write(content)
+        open(os.path.join(build_style_path, '%s.min.css' % style), 'w', encoding='utf-8').write(content)
 
-def build(buildfunc, root, languages, options):
+def build(buildfunc, root, args):
     build_path = os.path.join(root, 'build')
     if os.path.exists(build_path):
         shutil.rmtree(build_path)
     os.mkdir(build_path)
-    filenames = language_filenames(os.path.join(root, 'src'), languages)
-    buildfunc(root, build_path, filenames, options)
-    print 'Done.'
+    filenames = language_filenames(os.path.join(root, 'src'), args.languages)
+    buildfunc(root, build_path, filenames, args)
+    print('Done.')
 
 if __name__ == '__main__':
-    parser = optparse.OptionParser()
-    parser.add_option(
+    parser = argparse.ArgumentParser(description='Build highlight.js for various targets')
+    parser.add_argument(
+        'languages', nargs='*',
+        help = 'language (the name of a language file without the .js extension) or :category (currently the only available category is ":common")',
+    )
+    parser.add_argument(
         '-n', '--no-compress',
         dest = 'compress', action = 'store_false', default = True,
         help = 'Don\'t compress source files. Compression only works for the "browser" target.',
     )
-    parser.add_option(
-        '-t', '--target',
-        dest = 'target', default = 'browser',
-        help = 'Target format: "browser" (default), "node", "cdn", "amd"',
+    parser.add_argument(
+        '-t', '--target', dest = 'target',
+        choices = ['browser', 'node', 'cdn', 'amd'], default = 'browser',
+        help = 'Target format, default is "browser"',
     )
-    parser.set_usage('''%%prog [options] [<language>|:<category> ...]
-
-- <language> is the name of a language file without the .js extension
-- <category> is a pre-defined set of language names: %s''' % ', '.join(CATEGORIES.keys()))
-    options, args = parser.parse_args()
-    try:
-        buildfunc = locals()['build_%s' % options.target]
-    except KeyError:
-        print 'Unknown target:', options.target
-        sys.exit(1)
+    args = parser.parse_args()
+    buildfunc = locals()['build_%s' % args.target]
     root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-    build(buildfunc, root, args, options)
+    build(buildfunc, root, args)
diff --git a/tools/build3.py b/tools/build3.py
deleted file mode 100644
index b226db8..0000000
--- a/tools/build3.py
+++ /dev/null
@@ -1,305 +0,0 @@
-# -*- coding:utf-8 -*-
-'''
-Function for building whole packed version of highlight.js out of
-pre-packed modules.
-'''
-
-import os
-import shutil
-import sys
-import re
-import optparse
-import subprocess
-import json
-from functools import partial
-
-REPLACES = {
-    'case_insensitive': 'cI',
-    'lexems': 'l',
-    'contains': 'c',
-    'keywords': 'k',
-    'subLanguage': 'sL',
-    'className': 'cN',
-    'begin': 'b',
-    'beginWithKeyword': 'bWK',
-    'end': 'e',
-    'endsWithParent': 'eW',
-    'illegal': 'i',
-    'excludeBegin': 'eB',
-    'excludeEnd': 'eE',
-    'returnBegin': 'rB',
-    'returnEnd': 'rE',
-    'relevance': 'r',
-
-    'IDENT_RE': 'IR',
-    'UNDERSCORE_IDENT_RE': 'UIR',
-    'NUMBER_RE': 'NR',
-    'C_NUMBER_RE': 'CNR',
-    'BINARY_NUMBER_RE': 'BNR',
-    'RE_STARTERS_RE': 'RSR',
-    'APOS_STRING_MODE': 'ASM',
-    'QUOTE_STRING_MODE': 'QSM',
-    'BACKSLASH_ESCAPE': 'BE',
-    'C_LINE_COMMENT_MODE': 'CLCM',
-    'C_BLOCK_COMMENT_MODE': 'CBLCLM',
-    'HASH_COMMENT_MODE': 'HCM',
-    'C_NUMBER_MODE': 'CNM',
-    'BINARY_NUMBER_MODE': 'BNM',
-    'NUMBER_MODE': 'NM',
-
-    'beginRe': 'bR',
-    'endRe': 'eR',
-    'illegalRe': 'iR',
-    'lexemsRe': 'lR',
-    'terminators': 't',
-    'terminator_end': 'tE',
-}
-
-CATEGORIES = {
-    'common': ['bash', 'java', 'ini', 'sql', 'diff', 'php', 'cs', 'cpp', 'ruby', 'python', 'css', 'perl', 'xml', 'javascript', 'http', 'json'],
-}
-
-def lang_name(filename):
-    return os.path.splitext(os.path.basename(filename))[0]
-
-def mapnonstrings(source, func):
-    result = []
-    pos = 0
-    quotes = re.compile('[\'"]')
-    while pos < len(source):
-        match = quotes.search(source, pos)
-        end = match.start() if match else len(source)
-        result.append(func(source[pos:end]))
-        pos = end
-        if match:
-            terminator = re.compile(r'[%s\\]' % match.group(0))
-            start = pos
-            pos += 1
-            while True:
-                match = terminator.search(source, pos)
-                if not match:
-                    raise ValueError('Unmatched quote')
-                if match.group(0) == '\\':
-                    pos = match.start() + 2
-                else:
-                    pos = match.start() + 1
-                    result.append(source[start:pos])
-                    break
-    return ''.join(result)
-
-def compress_content(tools_path, content, filetype='js'):
-    if filetype == 'js':
-        for s, r in REPLACES.items():
-            content = mapnonstrings(content, partial(re.sub, r'\b%s\b' % s, r))
-        content = re.sub(r'(block|parentNode)\.cN', r'\1.className', content)
-
-    args = ['java', '-jar', os.path.join(tools_path, 'yuicompressor.jar'), '--type', filetype]
-    p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-    p.stdin.write(content.encode('utf-8'))
-    p.stdin.close()
-    content = p.stdout.read().decode('utf-8')
-    p.stdout.close()
-
-    return content
-
-def parse_header(content):
-    '''
-    Parses possible language description header from a file. If a header is found returns it
-    as dict, otherwise returns None.
-    '''
-    match = re.search(r'^\s*/\*(.*?)\*/', content, re.S)
-    if not match:
-        return
-    headers = match.group(1).split('\n')
-    headers = dict(h.strip().split(': ') for h in headers if ': ' in h)
-    return headers if 'Language' in headers else None
-
-def language_filenames(src_path, languages):
-    '''
-    Resolves dependencies and returns the list of actual language filenames
-    '''
-    lang_path = os.path.join(src_path, 'languages')
-    filenames = os.listdir(lang_path)
-    infos = [
-        (parse_header(open(os.path.join(lang_path, f)).read(1024)), f)
-        for f in filenames
-    ]
-    infos = [(i, f) for i, f in infos if i]
-
-    # Filtering infos based on list of languages and categories
-    if languages:
-        categories = set(l for l in languages if l.startswith(':'))
-        languages = set(languages) - categories
-        categories = set(c.strip(':') for c in categories)
-        cat_languages = set(l for c, ls in CATEGORIES.items() if c in categories for l in ls)
-        languages |= cat_languages
-        infos = [
-            (i, f) for i, f in infos
-            if lang_name(f) in languages
-        ]
-
-    def append(filename):
-        if filename not in filenames:
-            filenames.append(filename)
-
-    filenames = []
-    for info, filename in infos:
-        if 'Requires' in info:
-            requires = [r.strip() for r in info['Requires'].split(',')]
-            for r in requires:
-                append(r)
-        append(filename)
-    return [os.path.join(lang_path, f) for f in filenames]
-
-def strip_read(filename):
-    s = open(filename).read()
-    pattern = re.compile(r'^\s*(/\*(.*?)\*/)?\s*', re.DOTALL)
-    s = pattern.sub('', s)
-    return s.strip()
-
-def wrap_language(filename, content, compressed):
-    '''
-    Wraps a language file content for the browser build. The "compressed" parameter
-    selects which wrapping code to use:
-
-    - If compressed is False the function expects source files to be uncompressed and
-      wraps them maintaining readability of the source.
-    - If compressed is True the function expects source files to be already compressed
-      individually and wraps them with the minimal code, effectively emulating
-      what yuicompressor does.
-    '''
-    name = lang_name(filename)
-    if compressed:
-        name = ('["%s"]' if '-' in name or name[0].isdigit() else '.%s') % name
-        content = content.rstrip(';')
-        wrap = 'hljs.LANGUAGES%s=%s(hljs);'
-    else:
-        wrap = 'hljs.LANGUAGES[\'%s\'] = %s(hljs);\n'
-    return wrap % (name, content)
-
-def glue_files(hljs_filename, language_filenames, compressed):
-    '''
-    Glues files together for the browser build.
-    '''
-    if compressed:
-        hljs = 'var hljs=new %s();' % strip_read(hljs_filename).rstrip(';')
-        file_func = lambda f: open(f).read()
-    else:
-        hljs = 'var hljs = new %s();\n' % strip_read(hljs_filename)
-        file_func = strip_read
-    return ''.join([hljs] + [wrap_language(f, file_func(f), compressed) for f in language_filenames])
-
-def build_browser(root, build_path, filenames, options):
-    src_path = os.path.join(root, 'src')
-    tools_path = os.path.join(root, 'tools')
-    print('Building %d files:\n%s' % (len(filenames), '\n'.join(filenames)))
-    content = glue_files(os.path.join(src_path, 'highlight.js'), filenames, False)
-    print('Uncompressed size:', len(content.encode('utf-8')))
-    if options.compress:
-        print('Compressing...')
-        content = compress_content(tools_path, content)
-        print('Compressed size:', len(content.encode('utf-8')))
-    open(os.path.join(build_path, 'highlight.pack.js'), 'w').write(content)
-
-def build_amd(root, build_path, filenames, options):
-    src_path = os.path.join(root, 'src')
-    tools_path = os.path.join(root, 'tools')
-    print('Building %d files:\n%s' % (len(filenames), '\n'.join(filenames)))
-    content = glue_files(os.path.join(src_path, 'highlight.js'), filenames, False)
-    content = 'define(function() {\n%s\nreturn hljs;\n});' % content # AMD wrap
-    print('Uncompressed size:', len(content.encode('utf-8')))
-    if options.compress:
-        print('Compressing...')
-        content = compress_content(tools_path, content)
-        print('Compressed size:', len(content.encode('utf-8')))
-    open(os.path.join(build_path, 'highlight.pack.js'), 'w').write(content)
-
-def build_node(root, build_path, filenames, options):
-    src_path = os.path.join(root, 'src')
-    print('Building %d files:' % len(filenames))
-    for filename in filenames:
-        print(filename)
-        content = 'module.exports = %s;' % strip_read(filename)
-        open(os.path.join(build_path, os.path.basename(filename)), 'w').write(content)
-    filename = os.path.join(src_path, 'highlight.js')
-    print(filename)
-
-    print('Registering languages with the library...')
-    hljs = 'var hljs = new %s();' % strip_read(filename)
-    filenames = map(os.path.basename, filenames)
-    for filename in filenames:
-        hljs += '\nhljs.LANGUAGES[\'%s\'] = require(\'./%s\')(hljs);' % (lang_name(filename), filename)
-    hljs += '\nmodule.exports = hljs;'
-    open(os.path.join(build_path, 'highlight.js'), 'w').write(hljs)
-    if options.compress:
-        print('Notice: not compressing files for "node" target.')
-
-    print('Adding package.json...')
-    package = json.load(open(os.path.join(src_path, 'package.json')))
-    authors = open(os.path.join(root, 'AUTHORS.en.txt'))
-    matches = (re.match('^- (?P<name>.*) <(?P<email>.*)>$', a) for a in authors)
-    package['contributors'] = [m.groupdict() for m in matches if m]
-    content = json.dumps(package, indent=2)
-    open(os.path.join(build_path, 'package.json'), 'w').write(content)
-
-def build_cdn(root, build_path, filenames, options):
-    src_path = os.path.join(root, 'src')
-    tools_path = os.path.join(root, 'tools')
-    if not options.compress:
-        print('Notice: forcing compression for "cdn" target')
-        options.compress = True
-    build_browser(root, build_path, filenames, options)
-    os.rename(os.path.join(build_path, 'highlight.pack.js'), os.path.join(build_path, 'highlight.min.js'))
-    print('Compressing all languages...')
-    lang_path = os.path.join(build_path, 'languages')
-    os.mkdir(lang_path)
-    all_filenames = language_filenames(src_path, [])
-    for filename in all_filenames:
-        print(filename)
-        content = compress_content(tools_path, open(filename).read())
-        content = wrap_language(filename, content, True)
-        open(os.path.join(lang_path, '%s.min.js' % lang_name(filename)), 'w').write(content)
-    print('Compressing styles...')
-    build_style_path = os.path.join(build_path, 'styles')
-    src_style_path = os.path.join(src_path, 'styles')
-    os.mkdir(build_style_path)
-    styles = [lang_name(f) for f in os.listdir(src_style_path) if f.endswith('.css')]
-    for style in styles:
-        filename = os.path.join(src_style_path, '%s.css' % style)
-        print(filename)
-        content = compress_content(tools_path, open(filename).read(), 'css')
-        open(os.path.join(build_style_path, '%s.min.css' % style), 'w').write(content)
-
-def build(buildfunc, root, languages, options):
-    build_path = os.path.join(root, 'build')
-    if os.path.exists(build_path):
-        shutil.rmtree(build_path)
-    os.mkdir(build_path)
-    filenames = language_filenames(os.path.join(root, 'src'), languages)
-    buildfunc(root, build_path, filenames, options)
-    print('Done.')
-
-if __name__ == '__main__':
-    parser = optparse.OptionParser()
-    parser.add_option(
-        '-n', '--no-compress',
-        dest = 'compress', action = 'store_false', default = True,
-        help = 'Don\'t compress source files. Compression only works for the "browser" target.',
-    )
-    parser.add_option(
-        '-t', '--target',
-        dest = 'target', default = 'browser',
-        help = 'Target format: "browser" (default), "node", "cdn", "amd"',
-    )
-    parser.set_usage('''%%prog [options] [<language>|:<category> ...]
-
-- <language> is the name of a language file without the .js extension
-- <category> is a pre-defined set of language names: %s''' % ', '.join(CATEGORIES))
-    options, args = parser.parse_args()
-    try:
-        buildfunc = locals()['build_%s' % options.target]
-    except KeyError:
-        print('Unknown target:', options.target)
-        sys.exit(1)
-    root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-    build(buildfunc, root, args, options)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/highlight.js.git



More information about the Pkg-javascript-commits mailing list