[Pkg-javascript-commits] [highlight.js] 03/10: Imported Upstream version 8.0+ds

Cédric Boutillier boutil at moszumanska.debian.org
Sun Mar 2 08:56:38 UTC 2014


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

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

commit b0b81edfd3d8550947621452edf4cb7618e6a3ca
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Feb 19 00:39:01 2014 +0100

    Imported Upstream version 8.0+ds
---
 .gitignore                             |   1 +
 AUTHORS.en.txt                         |  24 +-
 AUTHORS.ru.txt                         |  22 +-
 CHANGES.md                             | 827 ++++++++++++++++++++++++++++++++
 README.md                              |  25 +-
 README.ru.md                           |  24 +-
 classref.txt                           | 676 --------------------------
 docs/api.rst                           |  84 +++-
 docs/conf.py                           |   4 +-
 docs/contribution.rst                  |   3 +-
 docs/css-classes-reference.rst         | 844 +++++++++++++++++++++++++++++++++
 docs/index.rst                         |   2 +
 docs/language-guide.rst                |   8 +-
 docs/language-requests.rst             |  17 +
 docs/line-numbers.rst                  |   2 +-
 docs/reference.rst                     |  94 +++-
 src/highlight.js                       | 445 +++++++++--------
 src/languages/1c.js                    |  13 +-
 src/languages/actionscript.js          |  22 +-
 src/languages/apache.js                | 137 ++----
 src/languages/applescript.js           |   8 +-
 src/languages/asciidoc.js              |  14 +-
 src/languages/autohotkey.js            |  65 +++
 src/languages/avrasm.js                |   2 +-
 src/languages/axapta.js                |  11 +-
 src/languages/bash.js                  |  29 +-
 src/languages/brainfuck.js             |  18 +-
 src/languages/clojure.js               |  35 +-
 src/languages/cmake.js                 |  44 +-
 src/languages/coffeescript.js          |  83 ++--
 src/languages/cpp.js                   |  16 +-
 src/languages/cs.js                    |  43 +-
 src/languages/css.js                   |   2 +-
 src/languages/d.js                     |   5 +-
 src/languages/delphi.js                |  79 ++-
 src/languages/diff.js                  |  47 +-
 src/languages/django.js                | 102 ++--
 src/languages/erlang.js                |  17 +-
 src/languages/fix.js                   |  33 ++
 src/languages/fsharp.js                |  20 +-
 src/languages/go.js                    |   4 +-
 src/languages/haml.js                  |  44 +-
 src/languages/handlebars.js            |  80 ++--
 src/languages/haskell.js               | 132 ++++--
 src/languages/ini.js                   |   2 +-
 src/languages/java.js                  |  38 +-
 src/languages/javascript.js            |  31 +-
 src/languages/lasso.js                 | 225 ++++++---
 src/languages/lisp.js                  |  65 ++-
 src/languages/livecodeserver.js        | 176 +++++++
 src/languages/lua.js                   |  10 +-
 src/languages/makefile.js              |  48 ++
 src/languages/markdown.js              |  65 ++-
 src/languages/mathematica.js           |  63 +++
 src/languages/matlab.js                |  20 +-
 src/languages/mel.js                   |  15 +-
 src/languages/nginx.js                 |  76 ++-
 src/languages/objectivec.js            |  30 +-
 src/languages/ocaml.js                 |  48 ++
 src/languages/oxygene.js               |  70 +++
 src/languages/perl.js                  | 139 +++---
 src/languages/php.js                   | 102 ++--
 src/languages/profile.js               |   8 +-
 src/languages/python.js                | 102 ++--
 src/languages/r.js                     |  16 +-
 src/languages/rsl.js                   |   6 +-
 src/languages/ruby.js                  | 216 ++++-----
 src/languages/ruleslanguage.js         |  74 +--
 src/languages/rust.js                  |  19 +-
 src/languages/scala.js                 |  12 +-
 src/languages/scilab.js                |  63 +++
 src/languages/scss.js                  |   2 +-
 src/languages/smalltalk.js             |  11 +-
 src/languages/sql.js                   |  12 +-
 src/languages/vala.js                  |   8 +-
 src/languages/vbnet.js                 |   2 +-
 src/languages/vbscript.js              |   3 +-
 src/languages/xml.js                   |  54 +--
 src/package.json                       |  10 +-
 src/styles/arta.css                    | 221 ++++-----
 src/styles/ascetic.css                 |  64 +--
 src/styles/atelier-dune.dark.css       |  93 ++++
 src/styles/atelier-dune.light.css      |  93 ++++
 src/styles/atelier-forest.dark.css     |  93 ++++
 src/styles/atelier-forest.light.css    |  93 ++++
 src/styles/atelier-heath.dark.css      |  93 ++++
 src/styles/atelier-heath.light.css     |  93 ++++
 src/styles/atelier-lakeside.dark.css   |  93 ++++
 src/styles/atelier-lakeside.light.css  |  93 ++++
 src/styles/atelier-seaside.dark.css    |  93 ++++
 src/styles/atelier-seaside.light.css   |  93 ++++
 src/styles/brown_paper.css             | 153 +++---
 src/styles/dark.css                    | 155 +++---
 src/styles/default.css                 | 230 ++++-----
 src/styles/docco.css                   | 119 ++---
 src/styles/far.css                     | 165 +++----
 src/styles/foundation.css              |  88 ++--
 src/styles/github.css                  | 122 +++--
 src/styles/googlecode.css              | 160 ++++---
 src/styles/idea.css                    | 125 ++---
 src/styles/ir_black.css                | 112 ++---
 src/styles/magula.css                  | 159 ++++---
 src/styles/mono-blue.css               |  85 ++--
 src/styles/monokai.css                 | 183 +++----
 src/styles/monokai_sublime.css         | 250 ++++++----
 src/styles/obsidian.css                | 189 ++++----
 src/styles/paraiso.dark.css            |  93 ++++
 src/styles/paraiso.light.css           |  93 ++++
 src/styles/pojoaque.css                | 118 ++---
 src/styles/railscasts.css              | 159 ++++---
 src/styles/rainbow.css                 | 126 +++--
 src/styles/school_book.css             | 155 +++---
 src/styles/solarized_dark.css          | 136 +++---
 src/styles/solarized_light.css         | 136 +++---
 src/styles/sunburst.css                | 145 +++---
 src/styles/tomorrow-night-blue.css     |  73 ++-
 src/styles/tomorrow-night-bright.css   |  73 ++-
 src/styles/tomorrow-night-eighties.css |  73 ++-
 src/styles/tomorrow-night.css          |  73 ++-
 src/styles/tomorrow.css                |  73 ++-
 src/styles/vs.css                      | 137 +++---
 src/styles/xcode.css                   | 188 ++++----
 src/styles/zenburn.css                 | 143 +++---
 src/test.html                          | 513 +++++++++++++++-----
 tools/build.py                         |  88 ++--
 125 files changed, 7784 insertions(+), 4369 deletions(-)

diff --git a/.gitignore b/.gitignore
index 865b546..4792b97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
 build
 docs/_build
 __pycache__
+*.swp
diff --git a/AUTHORS.en.txt b/AUTHORS.en.txt
index e593c21..fb50ac3 100644
--- a/AUTHORS.en.txt
+++ b/AUTHORS.en.txt
@@ -2,8 +2,11 @@ Syntax highlighting with language autodetection.
 
 URL:   http://highlightjs.org/
 
-Original author and current maintainer:
-Ivan Sagalaev <maniac at softwaremaniacs.org>
+Core developers (in order of appearance):
+
+- Ivan Sagalaev (original author) <maniac at softwaremaniacs.org>
+- Jeremy Hull <sourdrums at gmail.com>
+- Oleg Efimov <efimovov at gmail.com>
 
 Contributors:
 
@@ -36,7 +39,6 @@ Contributors:
 - Loren Segal <lsegal at soen.ca>
 - Andrew Fedorov <dmmdrs at mail.ru>
 - Igor Kalnitsky <igor at kalnitsky.org>
-- Jeremy Hull <sourdrums at gmail.com>
 - Valerii Hiora <valerii.hiora at gmail.com>
 - Nikolay Zakharov <nikolay.desh at gmail.com>
 - Dmitry Kovega <arhibot at gmail.com>
@@ -49,7 +51,6 @@ Contributors:
 - Alexander Myadzel <myadzel at gmail.com>
 - Evgeny Stepanischev <imbolk at gmail.com>
 - Dmytrii Nagirniak <dnagir at gmail.com>
-- Oleg Efimov <efimovov at gmail.com>
 - Luigi Maselli <grigio.org at gmail.com>
 - Denis Bardadym <bardadymchik at gmail.com>
 - Aahan Krish <geekpanth3r at gmail.com>
@@ -82,3 +83,18 @@ Contributors:
 - Poren Chiang <ren.chiang at gmail.com>
 - Kelley van Evert <kelleyvanevert at gmail.com>
 - Kurt Emch <kurt at kurtemch.com>
+- Mehdi Dogguy <mehdi at dogguy.org>
+- Nicolas Braud-Santoni <nicolas.braud-santoni at ens-cachan.fr>
+- Ralf Bitter <rabit at revigniter.com>
+- Sylvestre Ledru <sylvestre.ledru at scilab-enterprises.com>
+- Troy Kershaw <hello at troykershaw.com>
+- Zena Treep <zena.treep at gmail.com>
+- Daniel Kvasnicka <dkvasnicka at vendavo.com>
+- Carlo Kok <ck at remobjects.com>
+- Bram de Haan <info at atelierbramdehaan.nl>
+- Seongwon Lee <dlimpid at gmail.com>
+- Zaven Muradyan <megalivoithos at gmail.com>
+- Jan T. Sott <jan at idleberg.com>
+- Brent Bradbury <brent at brentium.com>
+- Martin Dilling-Hansen <martindlling at gmail.com>
+- Ilya Vassilevsky <vassilevsky at gmail.com>
diff --git a/AUTHORS.ru.txt b/AUTHORS.ru.txt
index 0b28b82..0292b1f 100644
--- a/AUTHORS.ru.txt
+++ b/AUTHORS.ru.txt
@@ -2,8 +2,11 @@
 
 URL:   http://highlightjs.org/
 
-Первоначальный автор и ведущий проекта:
-Иван Сагалаев <maniac at softwaremaniacs.org>
+Ключевые разработчики (в порядке появления):
+
+- Иван Сагалаев (первоначальный автор) <maniac at softwaremaniacs.org>
+- Джереми Халл <sourdrums at gmail.com>
+- Олег Ефимов <efimovov at gmail.com>
 
 Внесли свой вклад:
 
@@ -36,7 +39,6 @@ URL:   http://highlightjs.org/
 - Лорен Сегал <lsegal at soen.ca>
 - Андрей Фёдоров <dmmdrs at mail.ru>
 - Игорь Кальницкий <igor at kalnitsky.org>
-- Джереми Халл <sourdrums at gmail.com>
 - Валерий Хиора <valerii.hiora at gmail.com>
 - Николай Захаров <nikolay.desh at gmail.com>
 - Дмитрий Ковега <arhibot at gmail.com>
@@ -49,7 +51,6 @@ URL:   http://highlightjs.org/
 - Александр Мядзель <myadzel at gmail.com>
 - Евгений Степанищев <imbolk at gmail.com>
 - Дмитрий Нагирняк <dnagir at gmail.com>
-- Олег Ефимов <efimovov at gmail.com>
 - Луиджи Мазелли <grigio.org at gmail.com>
 - Денис Бардадым <bardadymchik at gmail.com>
 - Аахан Криш <geekpanth3r at gmail.com>
@@ -82,3 +83,16 @@ URL:   http://highlightjs.org/
 - Порен Чянь <ren.chiang at gmail.com>
 - Келли ван Эверт <kelleyvanevert at gmail.com>
 - Курт Эмч <kurt at kurtemch.com>
+- Мейди Догги <mehdi at dogguy.org>
+- Николя Бро-Сантони <nicolas.braud-santoni at ens-cachan.fr>
+- Ральф Биттер <rabit at revigniter.com>
+- Сильвестр Ледру <sylvestre.ledru at scilab-enterprises.com>
+- Трой Кершоу <hello at troykershaw.com>
+- Зена Трип <zena.treep at gmail.com>
+- Даниэль Квасничка <dkvasnicka at vendavo.com>
+- Карло Кок <ck at remobjects.com>
+- Брэм де Хаан <info at atelierbramdehaan.nl>
+- Сенгвон Ли <dlimpid at gmail.com>
+- Завен Мурадян <megalivoithos at gmail.com>
+- Ян Т. Сотт <jan at idleberg.com>
+- Брент Брэдбери <brent at brentium.com>
diff --git a/CHANGES.md b/CHANGES.md
new file mode 100644
index 0000000..f878062
--- /dev/null
+++ b/CHANGES.md
@@ -0,0 +1,827 @@
+## Version 8.0 beta
+
+This new major release is quite a big overhaul bringing both new features and
+some backwards incompatible changes. However, chances are that the majority of
+users won't be affected by the latter: the basic scenario described in the
+README is left intact.
+
+Here's what did change in an incompatible way:
+
+- We're now prefixing all classes located in [CSS classes reference][cr] with
+  `hljs-`, by default, because some class names would collide with other
+  people's stylesheets. If you were using an older version, you might still want
+  the previous behavior, but still want to upgrade. To suppress this new
+  behavior, you would initialize like so:
+
+  ```html
+  <script type="text/javascript">
+    hljs.configure({classPrefix: ''});
+    hljs.initHighlightingOnLoad();
+  </script>
+  ```
+
+- `tabReplace` and `useBR` that were used in different places are also unified
+  into the global options object and are to be set using `configure(options)`.
+  This function is documented in our [API docs][]. Also note that these
+  parameters are gone from `highlightBlock` and `fixMarkup` which are now also
+  rely on `configure`.
+
+- We removed public-facing (though undocumented) object `hljs.LANGUAGES` which
+  was used to register languages with the library in favor of two new methods:
+  `registerLanguage` and `getLanguage`. Both are documented in our [API docs][].
+
+- Result returned from `highlight` and `highlightAuto` no longer contains two
+  separate attributes contributing to relevance score, `relevance` and
+  `keyword_count`. They are now unified in `relevance`.
+
+Another technically compatible change that nonetheless might need attention:
+
+- The structure of the NPM package was refactored, so if you had installed it
+  locally, you'll have to update your paths. The usual `require('highlight.js')`
+  works as before. This is contributed by [Dmitry Smolin][].
+
+New features:
+
+- Languages now can be recognized by multiple names like "js" for JavaScript or
+  "html" for, well, HTML (which earlier insisted on calling it "xml"). These
+  aliases can be specified in the class attribute of the code container in your
+  HTML as well as in various API calls. For now there are only a few very common
+  aliases but we'll expand it in the future. All of them are listed in the
+  [class reference][].
+
+- Language detection can now be restricted to a subset of languages relevant in
+  a given context — a web page or even a single highlighting call. This is
+  especially useful for node.js build that includes all the known languages.
+  Another example is a StackOverflow-style site where users specify languages
+  as tags rather than in the markdown-formatted code snippets. This is
+  documented in the [API reference][] (see methods `highlightAuto` and
+  `configure`).
+
+- Language definition syntax streamlined with [variants][] and
+  [beginKeywords][].
+
+New languages and styles:
+
+- *Oxygene* by [Carlo Kok][]
+- *Mathematica* by [Daniel Kvasnička][]
+- *Autohotkey* by [Seongwon Lee][]
+- *Atelier* family of styles in 10 variants by [Bram de Haan][]
+- *Paraíso* styles by [Jan T. Sott][]
+
+Miscelleanous improvements:
+
+- Highlighting `=>` prompts in Clojure.
+- [Jeremy Hull][] fixed a lot of styles for consistency.
+- Finally, highlighting PHP and HTML [mixed in peculiar ways][php-html].
+- Objective C and C# now properly highlight titles in method definition.
+- Big overhaul of relevance counting for a number of languages. Please do report
+  bugs about mis-detection of non-trivial code snippets!
+
+[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html
+[api docs]: http://highlightjs.readthedocs.org/en/latest/api.html
+[variants]: https://groups.google.com/d/topic/highlightjs/VoGC9-1p5vk/discussion
+[beginKeywords]: https://github.com/isagalaev/highlight.js/commit/6c7fdea002eb3949577a85b3f7930137c7c3038d
+[php-html]: https://twitter.com/highlightjs/status/408890903017689088
+
+[Carlo Kok]: https://github.com/carlokok
+[Bram de Haan]: https://github.com/atelierbram
+[Daniel Kvasnička]: https://github.com/dkvasnicka
+[Dmitry Smolin]: https://github.com/dimsmol
+[Jeremy Hull]: https://github.com/sourrust
+[Seongwon Lee]: https://github.com/dlimpid
+[Jan T. Sott]: https://github.com/idleberg
+
+
+## Version 7.5
+
+A catch-up release dealing with some of the accumulated contributions. This one
+is probably will be the last before the 8.0 which will be slightly backwards
+incompatible regarding some advanced use-cases.
+
+One outstanding change in this version is the addition of 6 languages to the
+[hosted script][d]: Markdown, ObjectiveC, CoffeeScript, Apache, Nginx and
+Makefile. It now weighs about 6K more but we're going to keep it under 30K.
+
+New languages:
+
+- OCaml by [Mehdi Dogguy][mehdid] and [Nicolas Braud-Santoni][nbraud]
+- [LiveCode Server][lcs] by [Ralf Bitter][revig]
+- Scilab by [Sylvestre Ledru][sylvestre]
+- basic support for Makefile by [Ivan Sagalaev][isagalaev]
+
+Improvements:
+
+- Ruby's got support for characters like `?A`, `?1`, `?\012` etc. and `%r{..}`
+  regexps.
+- Clojure now allows a function call in the beginning of s-expressions
+  `(($filter "myCount") (arr 1 2 3 4 5))`.
+- Haskell's got new keywords and now recognizes more things like pragmas,
+  preprocessors, modules, containers, FFIs etc. Thanks to [Zena Treep][treep]
+  for the implementation and to [Jeremy Hull][sourrust] for guiding it.
+- Miscelleanous fixes in PHP, Brainfuck, SCSS, Asciidoc, CMake, Python and F#.
+
+[mehdid]: https://github.com/mehdid
+[nbraud]: https://github.com/nbraud
+[revig]: https://github.com/revig
+[lcs]: http://livecode.com/developers/guides/server/
+[sylvestre]: https://github.com/sylvestre
+[isagalaev]: https://github.com/isagalaev
+[treep]: https://github.com/treep
+[sourrust]: https://github.com/sourrust
+[d]: http://highlightjs.org/download/
+
+
+## New core developers
+
+The latest long period of almost complete inactivity in the project coincided
+with growing interest to it led to a decision that now seems completely obvious:
+we need more core developers.
+
+So without further ado let me welcome to the core team two long-time
+contributors: [Jeremy Hull][] and [Oleg
+Efimov][].
+
+Hope now we'll be able to work through stuff faster!
+
+P.S. The historical commit is [here][1] for the record.
+
+[Jeremy Hull]: https://github.com/sourrust
+[Oleg Efimov]: https://github.com/sannis
+[1]: https://github.com/isagalaev/highlight.js/commit/f3056941bda56d2b72276b97bc0dd5f230f2473f
+
+
+## Version 7.4
+
+This long overdue version is a snapshot of the current source tree with all the
+changes that happened during the past year. Sorry for taking so long!
+
+Along with the changes in code highlight.js has finally got its new home at
+<http://highlightjs.org/>, moving from its craddle on Software Maniacs which it
+outgrew a long time ago. Be sure to report any bugs about the site to
+<mailto:info at highlightjs.org>.
+
+On to what's new…
+
+New languages:
+
+- Handlebars templates by [Robin Ward][]
+- Oracle Rules Language by [Jason Jacobson][]
+- F# by [Joans Follesø][]
+- AsciiDoc and Haml by [Dan Allen][]
+- Lasso by [Eric Knibbe][]
+- SCSS by [Kurt Emch][]
+- VB.NET by [Poren Chiang][]
+- Mizar by [Kelley van Evert][]
+
+[Robin Ward]: https://github.com/eviltrout
+[Jason Jacobson]: https://github.com/jayce7
+[Joans Follesø]: https://github.com/follesoe
+[Dan Allen]: https://github.com/mojavelinux
+[Eric Knibbe]: https://github.com/EricFromCanada
+[Kurt Emch]: https://github.com/kemch
+[Poren Chiang]: https://github.com/rschiang
+[Kelley van Evert]: https://github.com/kelleyvanevert
+
+New style themes:
+
+- Monokai Sublime by [noformnocontent][]
+- Railscasts by [Damien White][]
+- Obsidian by [Alexander Marenin][]
+- Docco by [Simon Madine][]
+- Mono Blue by [Ivan Sagalaev][] (uses a single color hue for everything)
+- Foundation by [Dan Allen][]
+
+[noformnocontent]: http://nn.mit-license.org/
+[Damien White]: https://github.com/visoft
+[Alexander Marenin]: https://github.com/ioncreature
+[Simon Madine]: https://github.com/thingsinjars
+[Ivan Sagalaev]: https://github.com/isagalaev
+
+Other notable changes:
+
+- Corrected many corner cases in CSS.
+- Dropped Python 2 version of the build tool.
+- Implemented building for the AMD format.
+- Updated Rust keywords (thanks to [Dmitry Medvinsky][]).
+- Literal regexes can now be used in language definitions.
+- CoffeeScript highlighting is now significantly more robust and rich due to
+  input from [Cédric Néhémie][].
+
+[Dmitry Medvinsky]: https://github.com/dmedvinsky
+[Cédric Néhémie]: https://github.com/abe33
+
+
+## Version 7.3
+
+- Since this version highlight.js no longer works in IE version 8 and older.
+  It's made it possible to reduce the library size and dramatically improve code
+  readability and made it easier to maintain. Time to go forward!
+
+- New languages: AppleScript (by [Nathan Grigg][ng] and [Dr. Drang][dd]) and
+  Brainfuck (by [Evgeny Stepanischev][bolk]).
+
+- Improvements to existing languages:
+
+    - interpreter prompt in Python (`>>>` and `...`)
+    - @-properties and classes in CoffeeScript
+    - E4X in JavaScript (by [Oleg Efimov][oe])
+    - new keywords in Perl (by [Kirk Kimmel][kk])
+    - big Ruby syntax update (by [Vasily Polovnyov][vast])
+    - small fixes in Bash
+
+- Also Oleg Efimov did a great job of moving all the docs for language and style
+  developers and contributors from the old wiki under the source code in the
+  "docs" directory. Now these docs are nicely presented at
+  <http://highlightjs.readthedocs.org/>.
+
+[ng]: https://github.com/nathan11g
+[dd]: https://github.com/drdrang
+[bolk]: https://github.com/bolknote
+[oe]: https://github.com/Sannis
+[kk]: https://github.com/kimmel
+[vast]: https://github.com/vast
+
+
+## Version 7.2
+
+A regular bug-fix release without any significant new features. Enjoy!
+
+
+## Version 7.1
+
+A Summer crop:
+
+- [Marc Fornos][mf] made the definition for Clojure along with the matching
+  style Rainbow (which, of course, works for other languages too).
+- CoffeeScript support continues to improve getting support for regular
+  expressions.
+- Yoshihide Jimbo ported to highlight.js [five Tomorrow styles][tm] from the
+  [project by Chris Kempson][tm0].
+- Thanks to [Casey Duncun][cd] the library can now be built in the popular
+  [AMD format][amd].
+- And last but not least, we've got a fair number of correctness and consistency
+  fixes, including a pretty significant refactoring of Ruby.
+
+[mf]: https://github.com/mfornos
+[tm]: http://jmblog.github.com/color-themes-for-highlightjs/
+[tm0]: https://github.com/ChrisKempson/Tomorrow-Theme
+[cd]: https://github.com/caseman
+[amd]: http://requirejs.org/docs/whyamd.html
+
+
+## Version 7.0
+
+The reason for the new major version update is a global change of keyword syntax
+which resulted in the library getting smaller once again. For example, the
+hosted build is 2K less than at the previous version while supporting two new
+languages.
+
+Notable changes:
+
+- The library now works not only in a browser but also with [node.js][]. It is
+  installable with `npm install highlight.js`. [API][] docs are available on our
+  wiki.
+
+- The new unique feature (apparently) among syntax highlighters is highlighting
+  *HTTP* headers and an arbitrary language in the request body. The most useful
+  languages here are *XML* and *JSON* both of which highlight.js does support.
+  Here's [the detailed post][p] about the feature.
+
+- Two new style themes: a dark "south" *[Pojoaque][]* by Jason Tate and an
+  emulation of*XCode* IDE by [Angel Olloqui][ao].
+
+- Three new languages: *D* by [Aleksandar Ružičić][ar], *R* by [Joe Cheng][jc]
+  and *GLSL* by [Sergey Tikhomirov][st].
+
+- *Nginx* syntax has become a million times smaller and more universal thanks to
+  remaking it in a more generic manner that doesn't require listing all the
+  directives in the known universe.
+
+- Function titles are now highlighted in *PHP*.
+
+- *Haskell* and *VHDL* were significantly reworked to be more rich and correct
+  by their respective maintainers [Jeremy Hull][sr] and [Igor Kalnitsky][ik].
+
+And last but not least, many bugs have been fixed around correctness and
+language detection.
+
+Overall highlight.js currently supports 51 languages and 20 style themes.
+
+[node.js]: http://nodejs.org/
+[api]: http://softwaremaniacs.org/wiki/doku.php/highlight.js:api
+[p]: http://softwaremaniacs.org/blog/2012/05/10/http-and-json-in-highlight-js/en/
+[pojoaque]: http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html
+[ao]: https://github.com/angelolloqui
+[ar]: https://github.com/raleksandar
+[jc]: https://github.com/jcheng5
+[st]: https://github.com/tikhomirov
+[sr]: https://github.com/sourrust
+[ik]: https://github.com/ikalnitsky
+
+
+## Version 6.2
+
+A lot of things happened in highlight.js since the last version! We've got nine
+new contributors, the discussion group came alive, and the main branch on GitHub
+now counts more than 350 followers. Here are most significant results coming
+from all this activity:
+
+- 5 (five!) new languages: Rust, ActionScript, CoffeeScript, MatLab and
+  experimental support for markdown. Thanks go to [Andrey Vlasovskikh][av],
+  [Alexander Myadzel][am], [Dmytrii Nagirniak][dn], [Oleg Efimov][oe], [Denis
+  Bardadym][db] and [John Crepezzi][jc].
+
+- 2 new style themes: Monokai by [Luigi Maselli][lm] and stylistic imitation of
+  another well-known highlighter Google Code Prettify by [Aahan Krish][ak].
+
+- A vast number of [correctness fixes and code refactorings][log], mostly made
+  by [Oleg Efimov][oe] and [Evgeny Stepanischev][es].
+
+[av]: https://github.com/vlasovskikh
+[am]: https://github.com/myadzel
+[dn]: https://github.com/dnagir
+[oe]: https://github.com/Sannis
+[db]: https://github.com/btd
+[jc]: https://github.com/seejohnrun
+[lm]: http://grigio.org/
+[ak]: https://github.com/geekpanth3r
+[es]: https://github.com/bolknote
+[log]: https://github.com/isagalaev/highlight.js/commits/
+
+
+## Version 6.1 — Solarized
+
+[Jeremy Hull][jh] has implemented my dream feature — a port of [Solarized][]
+style theme famous for being based on the intricate color theory to achieve
+correct contrast and color perception. It is now available for highlight.js in
+both variants — light and dark.
+
+This version also adds a new original style Arta. Its author pumbur maintains a
+[heavily modified fork of highlight.js][pb] on GitHub.
+
+[jh]: https://github.com/sourrust
+[solarized]: http://ethanschoonover.com/solarized
+[pb]: https://github.com/pumbur/highlight.js
+
+
+## Version 6.0
+
+New major version of the highlighter has been built on a significantly
+refactored syntax. Due to this it's even smaller than the previous one while
+supporting more languages!
+
+New languages are:
+
+- Haskell by [Jeremy Hull][sourrust]
+- Erlang in two varieties — module and REPL — made collectively by [Nikolay
+  Zakharov][desh], [Dmitry Kovega][arhibot] and [Sergey Ignatov][ignatov]
+- Objective C by [Valerii Hiora][vhbit]
+- Vala by [Antono Vasiljev][antono]
+- Go by [Stephan Kountso][steplg]
+
+[sourrust]: https://github.com/sourrust
+[desh]: http://desh.su/
+[arhibot]: https://github.com/arhibot
+[ignatov]: https://github.com/ignatov
+[vhbit]: https://github.com/vhbit
+[antono]: https://github.com/antono
+[steplg]: https://github.com/steplg
+
+Also this version is marginally faster and fixes a number of small long-standing
+bugs.
+
+Developer overview of the new language syntax is available in a [blog post about
+recent beta release][beta].
+
+[beta]: http://softwaremaniacs.org/blog/2011/04/25/highlight-js-60-beta/en/
+
+P.S. New version is not yet available on a Yandex' CDN, so for now you have to
+download [your own copy][d].
+
+[d]: /soft/highlight/en/download/
+
+
+## Version 5.14
+
+Fixed bugs in HTML/XML detection and relevance introduced in previous
+refactoring.
+
+Also test.html now shows the second best result of language detection by
+relevance.
+
+
+## Version 5.13
+
+Past weekend began with a couple of simple additions for existing languages but
+ended up in a big code refactoring bringing along nice improvements for language
+developers.
+
+### For users
+
+- Description of C++ has got new keywords from the upcoming [C++ 0x][] standard.
+- Description of HTML has got new tags from [HTML 5][].
+- CSS-styles have been unified to use consistent padding and also have lost
+  pop-outs with names of detected languages.
+- [Igor Kalnitsky][ik] has sent two new language descriptions: CMake и VHDL.
+
+This makes total number of languages supported by highlight.js to reach 35.
+
+Bug fixes:
+
+- Custom classes on `<pre>` tags are not being overridden anymore
+- More correct highlighting of code blocks inside non-`<pre>` containers:
+  highlighter now doesn't insist on replacing them with its own container and
+  just replaces the contents.
+- Small fixes in browser compatibility and heuristics.
+
+[c++ 0x]: http://ru.wikipedia.org/wiki/C%2B%2B0x
+[html 5]: http://en.wikipedia.org/wiki/HTML5
+[ik]: http://kalnitsky.org.ua/
+
+### For developers
+
+The most significant change is the ability to include language submodes right
+under `contains` instead of defining explicit named submodes in the main array:
+
+    contains: [
+      'string',
+      'number',
+      {begin: '\\n', end: hljs.IMMEDIATE_RE}
+    ]
+
+This is useful for auxiliary modes needed only in one place to define parsing.
+Note that such modes often don't have `className` and hence won't generate a
+separate `<span>` in the resulting markup. This is similar in effect to
+`noMarkup: true`. All existing languages have been refactored accordingly.
+
+Test file test.html has at last become a real test. Now it not only puts the
+detected language name under the code snippet but also tests if it matches the
+expected one. Test summary is displayed right above all language snippets.
+
+
+## CDN
+
+Fine people at [Yandex][] agreed to host highlight.js on their big fast servers.
+[Link up][l]!
+
+[yandex]: http://yandex.com/
+[l]: http://softwaremaniacs.org/soft/highlight/en/download/
+
+
+## Version 5.10 — "Paris".
+
+Though I'm on a vacation in Paris, I decided to release a new version with a
+couple of small fixes:
+
+- Tomas Vitvar discovered that TAB replacement doesn't always work when used
+  with custom markup in code
+- SQL parsing is even more rigid now and doesn't step over SmallTalk in tests
+
+
+## Version 5.9
+
+A long-awaited version is finally released.
+
+New languages:
+
+- Andrew Fedorov made a definition for Lua
+- a long-time highlight.js contributor [Peter Leonov][pl] made a definition for
+  Nginx config
+- [Vladimir Moskva][vm] made a definition for TeX
+
+[pl]: http://kung-fu-tzu.ru/
+[vm]: http://fulc.ru/
+
+Fixes for existing languages:
+
+- [Loren Segal][ls] reworked the Ruby definition and added highlighting for
+  [YARD][] inline documentation
+- the definition of SQL has become more solid and now it shouldn't be overly
+  greedy when it comes to language detection
+
+[ls]: http://gnuu.org/
+[yard]: http://yardoc.org/
+
+The highlighter has become more usable as a library allowing to do highlighting
+from initialization code of JS frameworks and in ajax methods (see.
+readme.eng.txt).
+
+Also this version drops support for the [WordPress][wp] plugin. Everyone is
+welcome to [pick up its maintenance][p] if needed.
+
+[wp]: http://wordpress.org/
+[p]: http://bazaar.launchpad.net/~isagalaev/+junk/highlight/annotate/342/src/wp_highlight.js.php
+
+
+## Version 5.8
+
+- Jan Berkel has contributed a definition for Scala. +1 to hotness!
+- All CSS-styles are rewritten to work only inside `<pre>` tags to avoid
+  conflicts with host site styles.
+
+
+## Version 5.7.
+
+Fixed escaping of quotes in VBScript strings.
+
+
+## Version 5.5
+
+This version brings a small change: now .ini-files allow digits, underscores and
+square brackets in key names.
+
+
+## Version 5.4
+
+Fixed small but upsetting bug in the packer which caused incorrect highlighting
+of explicitly specified languages. Thanks to Andrew Fedorov for precise
+diagnostics!
+
+
+## Version 5.3
+
+The version to fulfil old promises.
+
+The most significant change is that highlight.js now preserves custom user
+markup in code along with its own highlighting markup. This means that now it's
+possible to use, say, links in code. Thanks to [Vladimir Dolzhenko][vd] for the
+[initial proposal][1] and for making a proof-of-concept patch.
+
+Also in this version:
+
+- [Vasily Polovnyov][vp] has sent a GitHub-like style and has implemented
+  support for CSS @-rules and Ruby symbols.
+- Yura Zaripov has sent two styles: Brown Paper and School Book.
+- Oleg Volchkov has sent a definition for [Parser 3][p3].
+
+[1]: http://softwaremaniacs.org/forum/highlightjs/6612/
+[p3]: http://www.parser.ru/
+[vp]: http://vasily.polovnyov.ru/
+[vd]: http://dolzhenko.blogspot.com/
+
+
+## Version 5.2
+
+- at last it's possible to replace indentation TABs with something sensible (e.g. 2 or 4 spaces)
+- new keywords and built-ins for 1C by Sergey Baranov
+- a couple of small fixes to Apache highlighting
+
+
+## Version 5.1
+
+This is one of those nice version consisting entirely of new and shiny
+contributions!
+
+- [Vladimir Ermakov][vooon] created highlighting for AVR Assembler
+- [Ruslan Keba][rukeba] created highlighting for Apache config file. Also his
+  original visual style for it is now available for all highlight.js languages
+  under the name "Magula".
+- [Shuen-Huei Guan][drake] (aka Drake) sent new keywords for RenderMan
+  languages. Also thanks go to [Konstantin Evdokimenko][ke] for his advice on
+  the matter.
+
+[vooon]: http://vehq.ru/about/
+[rukeba]: http://rukeba.com/
+[drake]: http://drakeguan.org/
+[ke]: http://k-evdokimenko.moikrug.ru/
+
+
+## Version 5.0
+
+The main change in the new major version of highlight.js is a mechanism for
+packing several languages along with the library itself into a single compressed
+file. Now sites using several languages will load considerably faster because
+the library won't dynamically include additional files while loading.
+
+Also this version fixes a long-standing bug with Javascript highlighting that
+couldn't distinguish between regular expressions and division operations.
+
+And as usually there were a couple of minor correctness fixes.
+
+Great thanks to all contributors! Keep using highlight.js.
+
+
+## Version 4.3
+
+This version comes with two contributions from [Jason Diamond][jd]:
+
+- language definition for C# (yes! it was a long-missed thing!)
+- Visual Studio-like highlighting style
+
+Plus there are a couple of minor bug fixes for parsing HTML and XML attributes.
+
+[jd]: http://jason.diamond.name/weblog/
+
+
+## Version 4.2
+
+The biggest news is highlighting for Lisp, courtesy of Vasily Polovnyov. It's
+somewhat experimental meaning that for highlighting "keywords" it doesn't use
+any pre-defined set of a Lisp dialect. Instead it tries to highlight first word
+in parentheses wherever it makes sense. I'd like to ask people programming in
+Lisp to confirm if it's a good idea and send feedback to [the forum][f].
+
+Other changes:
+
+- Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
+- [Vladimir Epifanov][voldmar] has implemented javascript style switcher for
+  test.html
+- comments now allowed inside Ruby function definition
+- [MEL][] language from [Shuen-Huei Guan][drake]
+- whitespace now allowed between `<pre>` and `<code>`
+- better auto-detection of C++ and PHP
+- HTML allows embedded VBScript (`<% .. %>`)
+
+[f]: http://softwaremaniacs.org/forum/highlightjs/
+[voldmar]: http://voldmar.ya.ru/
+[mel]: http://en.wikipedia.org/wiki/Maya_Embedded_Language
+[drake]: http://drakeguan.org/
+
+
+## Version 4.1
+
+Languages:
+
+- Bash from Vah
+- DOS bat-files from Alexander Makarov (Sam)
+- Diff files from Vasily Polovnyov
+- Ini files from myself though initial idea was from Sam
+
+Styles:
+
+- Zenburn from Vladimir Epifanov, this is an imitation of a
+  [well-known theme for Vim][zenburn].
+- Ascetic from myself, as a realization of ideals of non-flashy highlighting:
+  just one color in only three gradations :-)
+
+In other news. [One small bug][bug] was fixed, built-in keywords were added for
+Python and C++ which improved auto-detection for the latter (it was shame that
+[my wife's blog][alenacpp] had issues with it from time to time). And lastly
+thanks go to Sam for getting rid of my stylistic comments in code that were
+getting in the way of [JSMin][].
+
+[zenburn]: http://en.wikipedia.org/wiki/Zenburn
+[alenacpp]: http://alenacpp.blogspot.com/
+[bug]: http://softwaremaniacs.org/forum/viewtopic.php?id=1823
+[jsmin]: http://code.google.com/p/jsmin-php/
+
+
+## Version 4.0
+
+New major version is a result of vast refactoring and of many contributions.
+
+Visible new features:
+
+- Highlighting of embedded languages. Currently is implemented highlighting of
+  Javascript and CSS inside HTML.
+- Bundled 5 ready-made style themes!
+
+Invisible new features:
+
+- Highlight.js no longer pollutes global namespace. Only one object and one
+  function for backward compatibility.
+- Performance is further increased by about 15%.
+
+Changing of a major version number caused by a new format of language definition
+files. If you use some third-party language files they should be updated.
+
+
+## Version 3.5
+
+A very nice version in my opinion fixing a number of small bugs and slightly
+increased speed in a couple of corner cases. Thanks to everybody who reports
+bugs in he [forum][f] and by email!
+
+There is also a new language — XML. A custom XML formerly was detected as HTML
+and didn't highlight custom tags. In this version I tried to make custom XML to
+be detected and highlighted by its own rules. Which by the way include such
+things as CDATA sections and processing instructions (`<? ... ?>`).
+
+[f]: http://softwaremaniacs.org/forum/viewforum.php?id=6
+
+
+## Version 3.3
+
+[Vladimir Gubarkov][xonix] has provided an interesting and useful addition.
+File export.html contains a little program that shows and allows to copy and
+paste an HTML code generated by the highlighter for any code snippet. This can
+be useful in situations when one can't use the script itself on a site.
+
+
+[xonix]: http://xonixx.blogspot.com/
+
+
+## Version 3.2 consists completely of contributions:
+
+- Vladimir Gubarkov has described SmallTalk
+- Yuri Ivanov has described 1C
+- Peter Leonov has packaged the highlighter as a Firefox extension
+- Vladimir Ermakov has compiled a mod for phpBB
+
+Many thanks to you all!
+
+
+## Version 3.1
+
+Three new languages are available: Django templates, SQL and Axapta. The latter
+two are sent by [Dmitri Roudakov][1]. However I've almost entirely rewrote an
+SQL definition but I'd never started it be it from the ground up :-)
+
+The engine itself has got a long awaited feature of grouping keywords
+("keyword", "built-in function", "literal"). No more hacks!
+
+[1]: http://roudakov.ru/
+
+
+## Version 3.0
+
+It is major mainly because now highlight.js has grown large and has become
+modular. Now when you pass it a list of languages to highlight it will
+dynamically load into a browser only those languages.
+
+Also:
+
+- Konstantin Evdokimenko of [RibKit][] project has created a highlighting for
+  RenderMan Shading Language and RenderMan Interface Bytestream. Yay for more
+  languages!
+- Heuristics for C++ and HTML got better.
+- I've implemented (at last) a correct handling of backslash escapes in C-like
+  languages.
+
+There is also a small backwards incompatible change in the new version. The
+function initHighlighting that was used to initialize highlighting instead of
+initHighlightingOnLoad a long time ago no longer works. If you by chance still
+use it — replace it with the new one.
+
+[RibKit]: http://ribkit.sourceforge.net/
+
+
+## Version 2.9
+
+Highlight.js is a parser, not just a couple of regular expressions. That said
+I'm glad to announce that in the new version 2.9 has support for:
+
+- in-string substitutions for Ruby -- `#{...}`
+- strings from from numeric symbol codes (like #XX) for Delphi
+
+
+## Version 2.8
+
+A maintenance release with more tuned heuristics. Fully backwards compatible.
+
+
+## Version 2.7
+
+- Nikita Ledyaev presents highlighting for VBScript, yay!
+- A couple of bugs with escaping in strings were fixed thanks to Mickle
+- Ongoing tuning of heuristics
+
+Fixed bugs were rather unpleasant so I encourage everyone to upgrade!
+
+
+## Version 2.4
+
+- Peter Leonov provides another improved highlighting for Perl
+- Javascript gets a new kind of keywords — "literals". These are the words
+  "true", "false" and "null"
+
+Also highlight.js homepage now lists sites that use the library. Feel free to
+add your site by [dropping me a message][mail] until I find the time to build a
+submit form.
+
+[mail]: mailto:Maniac at SoftwareManiacs.Org
+
+
+## Version 2.3
+
+This version fixes IE breakage in previous version. My apologies to all who have
+already downloaded that one!
+
+
+## Version 2.2
+
+- added highlighting for Javascript
+- at last fixed parsing of Delphi's escaped apostrophes in strings
+- in Ruby fixed highlighting of keywords 'def' and 'class', same for 'sub' in
+  Perl
+
+
+## Version 2.0
+
+- Ruby support by [Anton Kovalyov][ak]
+- speed increased by orders of magnitude due to new way of parsing
+- this same way allows now correct highlighting of keywords in some tricky
+  places (like keyword "End" at the end of Delphi classes)
+
+[ak]: http://anton.kovalyov.net/
+
+
+## Version 1.0
+
+Version 1.0 of javascript syntax highlighter is released!
+
+It's the first version available with English description. Feel free to post
+your comments and question to [highlight.js forum][forum]. And don't be afraid
+if you find there some fancy Cyrillic letters -- it's for Russian users too :-)
+
+[forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6
diff --git a/README.md b/README.md
index c25a0a5..0ee9637 100644
--- a/README.md
+++ b/README.md
@@ -28,9 +28,9 @@ If you use different markup or need to apply highlighting dynamically, read
 
 - 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
-  [classref.txt][cr] from the downloaded package.
+  [CSS classes reference][cr] from the downloaded package.
 
-[cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
+[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html
 
 
 ## node.js
@@ -89,9 +89,9 @@ styling:
 
 ```html
 <script type="text/javascript">
-  hljs.tabReplace = '    '; // 4 spaces
+  hljs.configure({tabReplace: '    '}); // 4 spaces
   // ... or
-  hljs.tabReplace = '<span class="indent">\t</span>';
+  hljs.configure({tabReplace: '<span class="indent">\t</span>'});
 
   hljs.initHighlightingOnLoad();
 </script>
@@ -100,9 +100,9 @@ styling:
 ## Custom initialization
 
 If you use different markup for code blocks you can initialize them manually
-with `highlightBlock(code, tabReplace, useBR)` function. It takes a DOM element
-containing the code to highlight and optionally a string with which to replace
-TAB characters.
+with `highlightBlock(code)` function. It takes a DOM element containing the
+code to highlight and optionally a string with which to replace TAB
+characters.
 
 Initialization using, for example, jQuery might look like this:
 
@@ -117,11 +117,11 @@ the page. Just make sure you don't do it twice for already highlighted
 blocks.
 
 If your code container relies on `<br>` tags instead of line breaks (i.e. if
-it's not `<pre>`) pass `true` into the third parameter of `highlightBlock`
-to make highlight.js use `<br>` in the output:
+it's not `<pre>`) set the `useBR` option to `true`:
 
 ```javascript
-$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
+hljs.configure({useBR: true});
+$('div.code').each(function(i, e) {hljs.highlightBlock(e)});
 ```
 
 
@@ -160,9 +160,8 @@ on a site.
 
 ## Meta
 
-- Version: 7.4
+- Version: 8.0
 - URL:     http://highlightjs.org/
-- Author:  Ivan Sagalaev (<maniac at softwaremaniacs.org>)
 
 For the license terms see LICENSE files.
-For the list of contributors see AUTHORS.en.txt file.
+For authors and contributors see AUTHORS.en.txt file.
diff --git a/README.ru.md b/README.ru.md
index 96dd86c..0d0e0fe 100644
--- a/README.ru.md
+++ b/README.ru.md
@@ -30,10 +30,9 @@ Highlight.js нужен для подсветки синтаксиса в при
 
 - Стилевые темы можно найти в загруженном архиве или также использовать
   захостенные. Чтобы сделать собственный стиль для своего сайта, вам
-  будет полезен справочник классов в файле [classref.txt][cr], который тоже
-  есть в архиве.
+  будет полезен [CSS classes reference][cr], который тоже есть в архиве.
 
-[cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt
+[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html
 
 
 ## node.js
@@ -92,9 +91,9 @@ require(["highlight.js/build/highlight.pack"], function(hljs){
 
 ```html
 <script type="text/javascript">
-  hljs.tabReplace = '    '; // 4 spaces
+  hljs.configure({tabReplace: '    '}); // 4 spaces
   // ... or
-  hljs.tabReplace = '<span class="indent">\t</span>';
+  hljs.configure({tabReplace: '<span class="indent">\t</span>'});
 
   hljs.initHighlightingOnLoad();
 </script>
@@ -104,9 +103,8 @@ require(["highlight.js/build/highlight.pack"], function(hljs){
 ## Инициализация вручную
 
 Если вы используете другие теги для блоков кода, вы можете инициализировать их
-явно с помощью функции `highlightBlock(code, tabReplace, useBR)`. Она принимает
-DOM-элемент с текстом расцвечиваемого кода и опционально - строчку для замены
-символов TAB.
+явно с помощью функции `highlightBlock(code)`. Она принимает DOM-элемент с
+текстом расцвечиваемого кода и опционально - строчку для замены символов TAB.
 
 Например с использованием jQuery код инициализации может выглядеть так:
 
@@ -121,10 +119,11 @@ $(document).ready(function() {
 повторно для уже раскрашенных блоков.
 
 Если ваш блок кода использует `<br>` вместо переводов строки (т.е. если это не
-`<pre>`), передайте `true` третьим параметром в `highlightBlock`:
+`<pre>`), включите опцию `useBR`:
 
 ```javascript
-$('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
+hljs.configure({useBR: true});
+$('div.code').each(function(i, e) {hljs.highlightBlock(e)});
 ```
 
 
@@ -165,9 +164,8 @@ highlight.js.
 
 ## Координаты
 
-- Версия: 7.4
+- Версия: 8.0
 - URL:    http://highlightjs.org/
-- Автор:  Иван Сагалаев (<maniac at softwaremaniacs.org>)
 
 Лицензионное соглашение читайте в файле LICENSE.
-Список соавторов читайте в файле AUTHORS.ru.txt
+Список авторов и соавторов читайте в файле AUTHORS.ru.txt
diff --git a/classref.txt b/classref.txt
deleted file mode 100644
index 262b612..0000000
--- a/classref.txt
+++ /dev/null
@@ -1,676 +0,0 @@
-This is a full list of available classes corresponding to languages'
-syntactic structures. The parentheses after language name contain identifiers
-used as class names in `<code>` element.
-
-Python ("python"):
-
-  keyword          keyword
-  built_in         built-in objects (None, False, True and Ellipsis)
-  number           number
-  string           string (of any type)
-  comment          comment
-  decorator        @-decorator for functions
-  function         function header "def some_name(...):"
-  class            class header "class SomeName(...):"
-  title            name of a function or a class inside a header
-  params           everything inside parentheses in a function's or class' header
-
-Python profiler results ("profile"):
-
-  number           number
-  string           string
-  built_in         built-in function entry
-  filename         filename in an entry
-  summary          profiling summary
-  header           header of table of results
-  keyword          column header
-  function         function name in an entry (including parentheses)
-  title            actual name of a function in an entry (excluding parentheses)
-  prompt           interpreter prompt (>>> or ...)
-
-Ruby ("ruby"):
-
-  keyword          keyword
-  string           string
-  subst            in-string substitution (#{...})
-  comment          comment
-  yardoctag        YARD tag
-  function         function header "def some_name(...):"
-  class            class header "class SomeName(...):"
-  title            name of a function or a class inside a header
-  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
-  comment          comment
-  number           number
-  string           string
-  regexp           regular expression
-  sub              subroutine header (from "sub" till "{")
-  variable         variable starting with "$", "%", "@"
-  operator         operator
-  pod              plain old doc
-
-PHP ("php"):
-
-  keyword          keyword
-  number           number
-  string           string (of any type)
-  comment          comment
-  phpdoc           phpdoc params in comments
-  variable         variable starting with "$"
-  preprocessor     preprocessor marks: "<?php" and "?>"
-
-Scala ("scala"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  annotation       annotation
-  javadoc          javadoc comment
-  javadoctag       @-tag in javadoc
-  class            class header
-  title            class name inside a header
-  params           everything in parentheses inside a class header
-  inheritance      keywords "extends" and "with" inside class header
-
-Go language ("go"):
-  comment          comment
-  string           string constant
-  number           number
-  keyword          language keywords
-  constant         true false nil iota
-  typename         built-in plain types (int, string etc.)
-  built_in         built-in functions
-
-HTML, XML ("xml"):
-
-  tag              any tag from "<" till ">"
-  attribute        tag's attribute with or without value
-  value            attribute's value
-  comment          comment
-  pi               processing instruction (<? ... ?>)
-  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
-  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
-
-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
-  bullet            list bullet
-  emphasis          emphasis
-  strong            strong emphasis
-  blockquote        blockquote
-  code              code
-  horizontal_rule   horizontal rule
-  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
-  tag              any tag from "<" till ">"
-  comment          comment
-  doctype          <!DOCTYPE ... > declaration
-  attribute        tag's attribute with or withou value
-  value            attribute's value
-  template_tag     template tag {% .. %}
-  variable         template variable {{ .. }}
-  template_comment template comment, both {# .. #} and {% comment %}
-  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
-  literal          "true", "false" and "null"
-  string           string value
-  attribute        name of an object property
-  value            value of an object property
-
-JavaScript ("javascript"):
-
-  keyword          keyword
-  comment          comment
-  number           number
-  literal          special literal: "true", "false" and "null"
-  string           string
-  regexp           regular expression
-  function         header of a function
-  title            name of a function inside a header
-  params           parentheses and everything inside them in a function's header
-
-CoffeeScript ("coffeescript"):
-
-  keyword          keyword
-  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
-  title            name of a function variable inside a header
-  params           parentheses and everything inside them in a function's header
-  property         @-property within class and functions
-
-ActionScript ("actionscript"):
-
-  comment          comment
-  string           string
-  number           number
-  keyword          keywords
-  literal          literal
-  reserved         reserved keyword
-  title            name of declaration (package, class or function)
-  preprocessor     preprocessor directive (import, include)
-  type             type of returned value (for functions)
-  package          package (named or not)
-  class            class/interface
-  function         function
-  param            params of function
-  rest_arg         rest argument of function
-
-VBScript ("vbscript"):
-
-  keyword          keyword
-  number           number
-  string           string
-  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
-  status           first line of a response
-  attribute        header name
-  string           header value or query string in a request line
-  number           status code
-
-Lua ("lua"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  built_in         built-in operator
-  function         header of a function
-  title            name of a function inside a header
-  params           everything inside parentheses in a function's header
-  long_brackets    multiline string in [=[ .. ]=]
-
-Delphi ("delphi"):
-
-  keyword          keyword
-  comment          comment (of any type)
-  number           number
-  string           string
-  function         header of a function, procedure, constructor and destructor
-  title            name of a function, procedure, constructor or destructor
-                   inside a header
-  params           everything inside parentheses in a function's header
-  class            class' body from "= class" till "end;"
-
-Java ("java"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  annotaion        annotation
-  javadoc          javadoc comment
-  class            class header from "class" till "{"
-  title            class name inside a header
-  params           everything in parentheses inside a class header
-  inheritance      keywords "extends" and "implements" inside class header
-
-C++ ("cpp"):
-
-  keyword          keyword
-  number           number
-  string           string and character
-  comment          comment
-  preprocessor     preprocessor directive
-  stl_container    instantiation of STL containers ("vector<...>")
-
-Objective C ("objectivec"):
-  keyword          keyword
-  built_in         Cocoa/Cocoa Touch constants and classes
-  number           number
-  string           string
-  comment          comment
-  preprocessor     preprocessor directive
-  class            interface/implementation, protocol and forward class declaration
-  variable         properties and struct accesors
-
-Vala ("vala"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  class            class definitions
-  title            in class definition
-  constant         ALL_UPPER_CASE
-
-C# ("cs"):
-
-  keyword          keyword
-  number           number
-  string           string
-  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
-  string           string constant
-  number           number
-  keyword          language keywords (including @attributes)
-  constant         true false null
-  built_in         built-in plain types (int, string etc.)
-
-RenderMan RSL ("rsl"):
-
-  keyword          keyword
-  number           number
-  string           string (including @"..")
-  comment          comment
-  preprocessor     preprocessor directive
-  shader           sahder keywords
-  shading          shading keywords
-  built_in         built-in function
-
-RenderMan RIB ("rib"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  commands         command
-
-Maya Embedded Language ("mel"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  variable         variable
-
-SQL ("sql"):
-
-  keyword          keyword (mostly SQL'92 and SQL'99)
-  number           number
-  string           string (of any type: "..", '..', `..`)
-  comment          comment
-  aggregate        aggregate function
-
-Smalltalk ("smalltalk"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  symbol           symbol
-  array            array
-  class            name of a class
-  char             char
-  localvars        block of local variables
-
-Lisp ("lisp"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  variable         variable
-  literal          b, t and nil
-  list             non-quoted list
-  title            first symbol in a non-quoted list
-  body             remainder of the non-quoted list
-  quoted           quoted list, both "(quote .. )" and "'(..)"
-
-Clojure ("clojure"):
-
-  comment          comments and hints
-  string           string
-  number           number
-  collection       collections
-  attribute        :keyword
-  title            function name (built-in or user defined)
-  built_in         built-in function name
-
-Ini ("ini"):
-
-  title            title of a section
-  value            value of a setting of any type
-  string           string
-  number           number
-  keyword          boolean value keyword
-
-Apache ("apache"):
-
-  keyword          keyword
-  number           number
-  comment          commment
-  literal          On and Off
-  sqbracket        variables in rewrites "%{..}"
-  cbracket         options in rewrites "[..]"
-  tag              begin and end of a configuration section
-
-Nginx ("nginx"):
-
-  title            directive title
-  string           string
-  number           number
-  comment          comment
-  built_in         built-in constant
-  variable         $-variable
-  regexp           regexp
-
-Diff ("diff"):
-
-  header           file header
-  chunk            chunk header within a file
-  addition         added lines
-  deletion         deleted lines
-  change           changed lines
-
-DOS ("dos"):
-
-  keyword          keyword
-  flow             batch control keyword
-  stream           DOS special files ("con", "prn", ...)
-  winutils         some commands (see dos.js specifically)
-  envvar           environment variables
-
-Bash ("bash"):
-
-  keyword          keyword
-  string           string
-  number           number
-  comment          comment
-  literal          special literal: "true" и "false"
-  variable         variable
-  shebang          script interpreter header
-
-CMake ("cmake")
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  envvar           $-variable
-
-Axapta ("axapta"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  class            class header from "class" till "{"
-  title            class name inside a header
-  params           everything in parentheses inside a class header
-  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
-  number           number
-  date             date
-  string           string
-  comment          commment
-  function         header of function or procudure
-  title            function name inside a header
-  params           everything in parentheses inside a function header
-  preprocessor     preprocessor directive
-
-AVR assembler ("avrasm"):
-
-  keyword          keyword
-  built_in         pre-defined register
-  number           number
-  string           string
-  comment          commment
-  label            label
-  preprocessor     preprocessor directive
-  localvars        substitution in .macro
-
-VHDL ("vhdl")
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          commment
-  literal          signal logical value
-  typename         typename
-  attribute        signal attribute
-
-Parser3 ("parser3"):
-
-  keyword          keyword
-  number           number
-  comment          commment
-  variable         variable starting with "$"
-  preprocessor     preprocessor directive
-  title            user-defined name starting with "@"
-
-TeX ("tex"):
-
-  comment          comment
-  number           number
-  command          command
-  parameter        parameter
-  formula          formula
-  special          special symbol
-
-Haskell ("haskell"):
-
-  keyword          keyword
-  number           number
-  string           string
-  comment          comment
-  class            type classes and other data types
-  title            function name
-  type             type class name
-  typedef          definition of types (type, newtype, data)
-
-Erlang ("erlang"):
-
-  comment          comment
-  string           string
-  number           number
-  keyword          keyword
-  record_name      record access (#record_name)
-  title            name of declaration function
-  variable         variable (starts with capital letter or with _)
-  pp.keywords      module's attribute (-attribute)
-  function_name    atom or atom:atom in case of function call
-
-Rust ("rust"):
-
-  comment          comment
-  string           string
-  number           number
-  keyword          keyword
-  title            name of declaration
-  preprocessor     preprocessor directive
-
-Matlab ("matlab"):
-
-  comment          comment
-  string           string
-  number           number
-  keyword          keyword
-  title            function name
-  function         function
-  param            params of function
-  matrix           matrix in [ .. ]
-  cell             cell in { .. }
-
-R ("r"):
-
-  comment          comment
-  string           string constant
-  number           number
-  keyword          language keywords (function, if) plus "structural"
-                   functions (attach, require, setClass)
-  literal          special literal: TRUE, FALSE, NULL, NA, etc.
-
-OpenGL Shading Language ("glsl"):
-
-  comment          comment
-  number           number
-  preprocessor     preprocessor directive
-  keyword          keyword
-  built_in         GLSL built-in functions and variables
-  literal          true false
-
-AppleScript ("applescript"):
-
-  keyword          keyword
-  command          core AppleScript command
-  constant         AppleScript built in constant
-  type             AppleScript variable type (integer, etc.)
-  property         Applescript built in property (length, etc.)
-  number           number
-  string           string
-  comment          comment
-  title            name of a handler
-
-Brainfuck ("brainfuck"):
-
-  title            Brainfuck while loop command
-  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 1c41d5b..dc42995 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -4,70 +4,106 @@ Library API
 Highilght.js exports a few functions as methods of the ``hljs`` object.
 
 
-``highlight(language_name, value, ignore_illegals)``
------------------------------------
+``highlight(name, value, ignore_illegals, continuation)``
+---------------------------------------------------------
 
 Core highlighting function.
-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.
+Accepts a language name, or an alias, and a string with the code to highlight.
+The ``ignore_illegals`` parameter, 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.
+The ``continuation`` is an optional mode stack representing unfinished parsing.
+When present, the function will restart parsing from this state instead of
+initializing a new one.
 Returns an object with the following properties:
 
 * ``language``: language name, same as the one passed into a function, returned for consistency with ``highlightAuto``
 * ``relevance``: integer value
-* ``keyword_count``: integer value
 * ``value``: HTML string with highlighting markup
+* ``top``: top of the current mode stack
 
 
-``highlightAuto(value)``
-------------------------
+``highlightAuto(value, languageSubset)``
+----------------------------------------
 
 Highlighting with language detection.
-Accepts a string with the code to highlight.
+Accepts a string with the code to highlight and an optional array of language names and aliases restricting detection to only those languages. The subset can also be set with ``configure``, but the local parameter overrides the option if set.
 Returns an object with the following properties:
 
 * ``language``: detected language
 * ``relevance``: integer value
-* ``keyword_count``: integer value
 * ``value``: HTML string with highlighting markup
 * ``second_best``: object with the same structure for second-best heuristically detected language, may be absent
 
 
-``fixMarkup(value, tabReplace, usBR)``
---------------------------------------
+``fixMarkup(value)``
+--------------------
 
-Post-processing of the highlighted markup.
-Accepts a string with the highlighted markup and two optional values:
+Post-processing of the highlighted markup. Currently consists of replacing indentation TAB characters and using ``<br>`` tags instead of new-line characters. Options are set globally with ``configure``.
 
-* ``tabReplace``: arbitrary string (may contain HTML) to replace TAB characters with
-* ``useBR``: a boolean flag to replace real line-breaks with ``<br>`` which is useful for non-``<pre>`` containers
+Accepts a string with the highlighted markup.
 
 
-``highlightBlock(block, tabReplace, useBR)``
---------------------------------------------
+``highlightBlock(block)``
+-------------------------
 
 Applies highlighting to a DOM node containing code.
-Accepts a DOM node and two optional parameters for ``fixMarkup``.
 
 This function is the one to use to apply highlighting dynamically after page load
 or within initialization code of third-party Javascript frameworks.
 
 
-``initHighlighting()``
+``configure(options)``
 ----------------------
 
-Applies highlighting to all ``<pre><code>..</code></pre>`` blocks on a page.
+Configures global options:
 
-To control tab replacement  use global flags on ``hljs`` object before initialization:
+* ``tabReplace``: a string used to replace TAB characters in indentation.
+* ``useBR``: a flag to generate ``<br>`` tags instead of new-line characters in the output, useful when code is marked up using a non-``<pre>`` container.
+* ``classPrefix``: a sting prefix added before class names in the generated markup, used for backwards compatibility with stylesheets.
+* ``languages``: an array of language names and aliases restricting auto detection to only these languages.
 
+Accepts an object representing options with the values to updated. Other options don't change
 ::
 
-  hljs.tabReplace = '    '; //4 spaces
+  hljs.configure({
+    tabReplace: '    ', // 4 spaces
+    classPrefix: ''     // don't append class prefix
+                        // … other options aren't changed
+  })
   hljs.initHighlighting();
 
 
+``initHighlighting()``
+----------------------
+
+Applies highlighting to all ``<pre><code>..</code></pre>`` blocks on a page.
+
+
+
 ``initHighlightingOnLoad()``
 ----------------------------
 
 Attaches highlighting to the page load event.
+
+
+``registerLanguage(name, language)``
+------------------------------------
+
+Adds new language to the library under the specified name. Used mostly internally.
+
+* ``name``: a string with the name of the language being registered
+* ``language``: a function that returns an object which represents the
+  language definition. The function is passed the ``hljs`` object to be able
+  to use common regular expressions defined within it.
+
+
+.. _getLanguage:
+
+
+``getLanguage(name)``
+---------------------
+
+Looks up a language by name or alias.
+
+Returns the language object if found, ``undefined`` otherwise.
diff --git a/docs/conf.py b/docs/conf.py
index 3ce5c96..09e811c 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.4'
+version = '8.0'
 # The full version, including alpha/beta/rc tags.
-release = '7.4'
+release = '8.0'
 
 # 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 44fb336..401354f 100644
--- a/docs/contribution.rst
+++ b/docs/contribution.rst
@@ -63,7 +63,8 @@ and test if it's properly detected and doesn't break detection of other language
 4. Write class reference
 ------------------------
 
-Class reference lives in the file ``classref.txt``. Describe shortly names of all meaningful modes used in your language definition.
+Class reference lives in the :doc:`CSS classes reference </css-classes-reference>`..
+Describe shortly names of all meaningful modes used in your language definition.
 
 
 5. Add yourself to AUTHORS.*.txt
diff --git a/docs/css-classes-reference.rst b/docs/css-classes-reference.rst
new file mode 100644
index 0000000..376a083
--- /dev/null
+++ b/docs/css-classes-reference.rst
@@ -0,0 +1,844 @@
+CSS classes reference
+=====================
+
+This is a full list of available classes corresponding to languages'
+syntactic structures. The parentheses after language name contain identifiers
+used as class names in ``<code>`` element.
+
+Python ("python")
+-----------------
+
+* ``keyword``:          keyword
+* ``built_in``:         built-in objects (None, False, True and Ellipsis)
+* ``number``:           number
+* ``string``:           string (of any type)
+* ``comment``:          comment
+* ``decorator``:        @-decorator for functions
+* ``function``:         function header "def some_name(...):"
+* ``class``:            class header "class SomeName(...):"
+* ``title``:            name of a function or a class inside a header
+* ``params``:           everything inside parentheses in a function's or class' header
+
+Python profiler results ("profile")
+-----------------------------------
+
+* ``number``:           number
+* ``string``:           string
+* ``built_in``:         built-in function entry
+* ``filename``:         filename in an entry
+* ``summary``:          profiling summary
+* ``header``:           header of table of results
+* ``keyword``:          column header
+* ``function``:         function name in an entry (including parentheses)
+* ``title``:            actual name of a function in an entry (excluding parentheses)
+* ``prompt``:           interpreter prompt (>>> or ...)
+
+Ruby ("ruby")
+-------------
+
+* ``keyword``:          keyword
+* ``string``:           string
+* ``subst``:            in-string substitution (#{...})
+* ``comment``:          comment
+* ``yardoctag``:        YARD tag
+* ``function``:         function header "def some_name(...):"
+* ``class``:            class header "class SomeName(...):"
+* ``title``:            name of a function or a class inside a header
+* ``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
+* ``comment``:          comment
+* ``number``:           number
+* ``string``:           string
+* ``regexp``:           regular expression
+* ``sub``:              subroutine header (from "sub" till "{")
+* ``variable``:         variable starting with "$", "%", "@"
+* ``operator``:         operator
+* ``pod``:              plain old doc
+
+PHP ("php")
+-----------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string (of any type)
+* ``comment``:          comment
+* ``phpdoc``:           phpdoc params in comments
+* ``variable``:         variable starting with "$"
+* ``preprocessor``:     preprocessor marks: "<?php" and "?>"
+
+Scala ("scala")
+---------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``annotation``:       annotation
+* ``javadoc``:          javadoc comment
+* ``javadoctag``:       @-tag in javadoc
+* ``class``:            class header
+* ``title``:            class name inside a header
+* ``params``:           everything in parentheses inside a class header
+* ``inheritance``:      keywords "extends" and "with" inside class header
+
+Go ("go", "golang")
+-------------------
+
+* ``comment``:          comment
+* ``string``:           string constant
+* ``number``:           number
+* ``keyword``:          language keywords
+* ``constant``:         true false nil iota
+* ``typename``:         built-in plain types (int, string etc.)
+* ``built_in``:         built-in functions
+
+HTML, XML ("xml", "html")
+-------------------------
+
+* ``tag``:              any tag from "<" till ">"
+* ``attribute``:        tag's attribute with or without value
+* ``value``:            attribute's value
+* ``comment``:          comment
+* ``pi``:               processing instruction (<? ... ?>)
+* ``doctype``:          <!DOCTYPE ... > declaration
+* ``cdata``:            CDATA section
+
+Lasso ("lasso", "ls", "lassoscript")
+------------------------------------
+
+* ``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
+* ``subst``:            unary/binary/ternary operator symbols
+* ``class``:            type, trait, or method header
+* ``title``:            name following "define" inside a header
+
+CSS ("css")
+-----------
+
+* ``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
+
+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
+* ``bullet``:            list bullet
+* ``emphasis``:          emphasis
+* ``strong``:            strong emphasis
+* ``blockquote``:        blockquote
+* ``code``:              code
+* ``horizontal_rule``:   horizontal rule
+* ``link_label``:        link label
+* ``link_url``:          link url
+* ``link_reference``:    link reference
+
+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
+* ``tag``:              any tag from "<" till ">"
+* ``comment``:          comment
+* ``doctype``:          <!DOCTYPE ... > declaration
+* ``attribute``:        tag's attribute with or withou value
+* ``value``:            attribute's value
+* ``template_tag``:     template tag {% .. %}
+* ``variable``:         template variable {{ .. }}
+* ``template_comment``: template comment, both {# .. #} and {% comment %}
+* ``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
+* ``literal``:          "true", "false" and "null"
+* ``string``:           string value
+* ``attribute``:        name of an object property
+* ``value``:            value of an object property
+
+Mathematica ("mathematica", "mma")
+----------------------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``comment``:          comment
+* ``string``:           string
+* ``list``:             a list { .. } - the basic Mma structure
+
+JavaScript ("javascript", "js")
+-------------------------------
+
+* ``keyword``:          keyword
+* ``comment``:          comment
+* ``number``:           number
+* ``literal``:          special literal: "true", "false" and "null"
+* ``string``:           string
+* ``regexp``:           regular expression
+* ``function``:         header of a function
+* ``title``:            name of a function inside a header
+* ``params``:           parentheses and everything inside them in a function's header
+* ``pi``:               'use strict' processing instruction
+
+CoffeeScript ("coffeescript")
+-----------------------------
+
+* ``keyword``:          keyword
+* ``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
+* ``title``:            name of a function variable inside a header
+* ``params``:           parentheses and everything inside them in a function's header
+* ``property``:         @-property within class and functions
+
+ActionScript ("actionscript")
+-----------------------------
+
+* ``comment``:          comment
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          keywords
+* ``literal``:          literal
+* ``reserved``:         reserved keyword
+* ``title``:            name of declaration (package, class or function)
+* ``preprocessor``:     preprocessor directive (import, include)
+* ``type``:             type of returned value (for functions)
+* ``package``:          package (named or not)
+* ``class``:            class/interface
+* ``function``:         function
+* ``param``:            params of function
+* ``rest_arg``:         rest argument of function
+
+VBScript ("vbscript")
+---------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``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
+* ``status``:           first line of a response
+* ``attribute``:        header name
+* ``string``:           header value or query string in a request line
+* ``number``:           status code
+
+Lua ("lua")
+-----------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``built_in``:         built-in operator
+* ``function``:         header of a function
+* ``title``:            name of a function inside a header
+* ``params``:           everything inside parentheses in a function's header
+* ``long_brackets``:    multiline string in [=[ .. ]=]
+
+Delphi ("delphi")
+-----------------
+
+* ``keyword``:          keyword
+* ``comment``:          comment (of any type)
+* ``number``:           number
+* ``string``:           string
+* ``function``:         header of a function, procedure, constructor and destructor
+* ``title``:            name of a function, procedure, constructor or destructor inside a header
+* ``params``:           everything inside parentheses in a function's header
+* ``class``:            class' body from "= class" till "end;"
+
+Oxygene ("oxygene")
+-------------------
+
+* ``keyword``:          keyword
+* ``comment``:          comment (of any type)
+* ``string``:           string/char
+* ``function``:         method, destructor, procedure or function
+* ``title``:            name of a function (inside function)
+* ``params``:           everything inside parentheses in a function's header
+* ``number``:           number
+* ``class``:            class' body from "= class" till "end;"
+
+Java ("java")
+-------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``annotaion``:        annotation
+* ``javadoc``:          javadoc comment
+* ``class``:            class header from "class" till "{"
+* ``title``:            class or method name
+* ``params``:           everything in parentheses inside a class header
+* ``inheritance``:      keywords "extends" and "implements" inside class header
+
+C++ ("cpp", "c")
+----------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string and character
+* ``comment``:          comment
+* ``preprocessor``:     preprocessor directive
+* ``stl_container``:    instantiation of STL containers ("vector<...>")
+
+Objective C ("objectivec")
+--------------------------
+
+* ``keyword``:          keyword
+* ``built_in``:         Cocoa/Cocoa Touch constants and classes
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``preprocessor``:     preprocessor directive
+* ``class``:            interface/implementation, protocol and forward class declaration
+* ``title``:            title (id) of interface, implementation, protocol, class
+* ``variable``:         properties and struct accesors
+
+Vala ("vala")
+-------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``class``:            class definitions
+* ``title``:            in class definition
+* ``constant``:         ALL_UPPER_CASE
+
+C# ("cs")
+---------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``xmlDocTag``:        xmldoc tag ("///", "<!--", "-->", "<..>")
+* ``title``:            title of namespace or class
+
+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
+
+OCaml ("ocaml")
+---------------
+
+* ``keywords``:         keyword
+* ``number``:           number
+* ``string``:           string
+* ``commment``:         comment\
+* ``class``:            any custom OCaml type
+* ``title``:            the name of a custom OCaml type
+* ``annotation``:       any attribute
+
+D ("d")
+-------
+
+* ``comment``:          comment
+* ``string``:           string constant
+* ``number``:           number
+* ``keyword``:          language keywords (including @attributes)
+* ``constant``:         true false null
+* ``built_in``:         built-in plain types (int, string etc.)
+
+RenderMan RSL ("rsl")
+---------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string (including @"..")
+* ``comment``:          comment
+* ``preprocessor``:     preprocessor directive
+* ``shader``:           sahder keywords
+* ``shading``:          shading keywords
+* ``built_in``:         built-in function
+
+RenderMan RIB ("rib")
+---------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``commands``:         command
+
+Maya Embedded Language ("mel")
+------------------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``variable``:         variable
+
+SQL ("sql")
+-----------
+
+* ``keyword``:          keyword (mostly SQL'92 and SQL'99)
+* ``number``:           number
+* ``string``:           string (of any type: "..", '..', \`..\`)
+* ``comment``:          comment
+* ``aggregate``:        aggregate function
+
+Smalltalk ("smalltalk")
+-----------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``symbol``:           symbol
+* ``array``:            array
+* ``class``:            name of a class
+* ``char``:             char
+* ``localvars``:        block of local variables
+
+Lisp ("lisp")
+-------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``variable``:         variable
+* ``literal``:          b, t and nil
+* ``list``:             non-quoted list
+* ``title``:            first symbol in a non-quoted list
+* ``body``:             remainder of the non-quoted list
+* ``quoted``:           quoted list, both "(quote .. )" and "'(..)"
+
+Clojure ("clojure")
+-------------------
+
+* ``comment``:          comments and hints
+* ``string``:           string
+* ``number``:           number
+* ``collection``:       collections
+* ``attribute``:        :keyword
+* ``title``:            function name (built-in or user defined)
+* ``built_in``:         built-in function name
+
+Ini ("ini")
+-----------
+
+* ``title``:            title of a section
+* ``value``:            value of a setting of any type
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          boolean value keyword
+
+Apache ("apache")
+-----------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``comment``:          commment
+* ``literal``:          On and Off
+* ``sqbracket``:        variables in rewrites "%{..}"
+* ``cbracket``:         options in rewrites "[..]"
+* ``tag``:              begin and end of a configuration section
+
+Nginx ("nginx")
+---------------
+
+* ``title``:            directive title
+* ``string``:           string
+* ``number``:           number
+* ``comment``:          comment
+* ``built_in``:         built-in constant
+* ``variable``:         $-variable
+* ``regexp``:           regexp
+
+Diff ("diff")
+-------------
+
+* ``header``:           file header
+* ``chunk``:            chunk header within a file
+* ``addition``:         added lines
+* ``deletion``:         deleted lines
+* ``change``:           changed lines
+
+DOS ("dos")
+-----------
+
+* ``keyword``:          keyword
+* ``flow``:             batch control keyword
+* ``stream``:           DOS special files ("con", "prn", ...)
+* ``winutils``:         some commands (see dos.js specifically)
+* ``envvar``:           environment variables
+
+Bash ("bash")
+-------------
+
+* ``keyword``:          keyword
+* ``string``:           string
+* ``number``:           number
+* ``comment``:          comment
+* ``literal``:          special literal: "true" и "false"
+* ``variable``:         variable
+* ``shebang``:          script interpreter header
+
+Makefile ("makefile")
+---------------------
+
+* ``keyword``:          keyword ".PHONY" within the phony line
+* ``string``:           string
+* ``comment``:          comment
+* ``variable``:         $(..) variable
+* ``title``:            target title
+* ``constant``:         constant within the initial definition
+
+CMake ("cmake")
+---------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``envvar``:           $-variable
+* ``operator``:         operator (LESS, STREQUAL, MATCHES, etc)
+
+Axapta ("axapta")
+-----------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``class``:            class header from "class" till "{"
+* ``title``:            class name inside a header
+* ``params``:           everything in parentheses inside a class header
+* ``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
+* ``number``:           number
+* ``date``:             date
+* ``string``:           string
+* ``comment``:          commment
+* ``function``:         header of function or procudure
+* ``title``:            function name inside a header
+* ``params``:           everything in parentheses inside a function header
+* ``preprocessor``:     preprocessor directive
+
+AVR assembler ("avrasm")
+------------------------
+
+* ``keyword``:          keyword
+* ``built_in``:         pre-defined register
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``label``:            label
+* ``preprocessor``:     preprocessor directive
+* ``localvars``:        substitution in .macro
+
+VHDL ("vhdl")
+-------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          commment
+* ``literal``:          signal logical value
+* ``typename``:         typename
+* ``attribute``:        signal attribute
+
+Parser3 ("parser3")
+-------------------
+
+* ``keyword``:          keyword
+* ``number``:           number
+* ``comment``:          commment
+* ``variable``:         variable starting with "$"
+* ``preprocessor``:     preprocessor directive
+* ``title``:            user-defined name starting with "@"
+
+LiveCode Server ("livecodeserver")
+----------------------------------
+
+* ``variable``:         variable starting with "g", "t", "p", "s", "$_"
+* ``string``:           string
+* ``comment``:          comment
+* ``number``:           number
+* ``title``:            name of a command or a function
+* ``keyword``:          keyword
+* ``constant``:         constant
+* ``operator``:         operator
+* ``built_in``:         built_in functions and commands
+* ``function``:         header of a function
+* ``command``:          header of a command
+* ``preprocessor``:     preprocessor marks: "<?", "<?rev", "<?lc", "<?livecode" and "?>"
+
+TeX ("tex")
+-----------
+
+* ``comment``:          comment
+* ``number``:           number
+* ``command``:          command
+* ``parameter``:        parameter
+* ``formula``:          formula
+* ``special``:          special symbol
+
+Haskell ("haskell")
+-------------------
+
+* ``comment``:          comment
+* ``pragma``:           GHC pragma
+* ``preprocessor``:     CPP preprocessor directive
+* ``keyword``:          keyword
+* ``number``:           number
+* ``string``:           string
+* ``title``:            function or variable name
+* ``type``:             value, type or type class constructor name (i.e. capitalized)
+* ``container``:        (..., ...) or {...; ...} list in declaration or record
+* ``module``:           module declaration
+* ``import``:           import declaration
+* ``class``:            type class or instance declaration
+* ``typedef``:          type declaration (type, newtype, data)
+* ``default``:          default declaration
+* ``infix``:            infix declaration
+* ``foreign``:          FFI declaration
+* ``shebang``:          shebang line
+
+Erlang ("erlang")
+-----------------
+
+* ``comment``:          comment
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          keyword
+* ``record_name``:      record access (#record_name)
+* ``title``:            name of declaration function
+* ``variable``:         variable (starts with capital letter or with _)
+* ``pp``:.keywords      module's attribute (-attribute)
+* ``function_name``:    atom or atom:atom in case of function call
+
+Rust ("rust")
+-------------
+
+* ``comment``:          comment
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          keyword
+* ``title``:            name of declaration
+* ``preprocessor``:     preprocessor directive
+
+Matlab ("matlab")
+-----------------
+
+* ``comment``:          comment
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          keyword
+* ``title``:            function name
+* ``function``:         function
+* ``param``:            params of function
+* ``matrix``:           matrix in [ .. ]
+* ``cell``:             cell in { .. }
+
+Scilab ("scilab")
+-----------------
+
+* ``comment``:          comment
+* ``string``:           string
+* ``number``:           number
+* ``keyword``:          keyword
+* ``title``:            function name
+* ``function``:         function
+* ``param``:            params of function
+* ``matrix``:           matrix in [ .. ]
+
+R ("r")
+-------
+
+* ``comment``:          comment
+* ``string``:           string constant
+* ``number``:           number
+* ``keyword``:          language keywords (function, if) plus "structural"
+                   functions (attach, require, setClass)
+* ``literal``:          special literal: TRUE, FALSE, NULL, NA, etc.
+
+OpenGL Shading Language ("glsl")
+--------------------------------
+
+* ``comment``:          comment
+* ``number``:           number
+* ``preprocessor``:     preprocessor directive
+* ``keyword``:          keyword
+* ``built_in``:         GLSL built-in functions and variables
+* ``literal``:          true false
+
+AppleScript ("applescript")
+---------------------------
+
+* ``keyword``:          keyword
+* ``command``:          core AppleScript command
+* ``constant``:         AppleScript built in constant
+* ``type``:             AppleScript variable type (integer, etc.)
+* ``property``:         Applescript built in property (length, etc.)
+* ``number``:           number
+* ``string``:           string
+* ``comment``:          comment
+* ``title``:            name of a handler
+
+Brainfuck ("brainfuck")
+-----------------------
+
+* ``title``:            Brainfuck while loop command
+* ``literal``:          Brainfuck inc and dec commands
+* ``comment``:          comment
+* ``string``:           Brainfuck input and output commands
+
+Mizar ("mizar")
+---------------
+
+* ``keyword``:          keyword
+* ``comment``:          comment
+
+AutoHotkey ("autohotkey")
+-------------------------
+
+* ``keyword``:          keyword
+* ``literal``:          A (active window), true, false, NOT, AND, OR
+* ``built_in``:         built-in variables
+* ``string``:           string
+* ``comment``:          comment
+* ``number``:           number
+* ``var_expand``:       variable expansion (enclosed in percent sign)
+* ``label``:            label, hotkey label, hotstring label
+
+FIX ("fix")
+-----------
+
+* ``attribute``:        attribute name
+* ``string``:           attribute value
diff --git a/docs/index.rst b/docs/index.rst
index be8af0f..9a09ff7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -14,6 +14,7 @@ Contents:
    api
    language-guide
    reference
+   css-classes-reference
    style-guide
    contribution
    building-testing
@@ -24,6 +25,7 @@ Miscellaneous:
    :maxdepth: 1
 
    line-numbers
+   language-requests
 
 Links:
 
diff --git a/docs/language-guide.rst b/docs/language-guide.rst
index bb12eb1..fe1b0c1 100644
--- a/docs/language-guide.rst
+++ b/docs/language-guide.rst
@@ -78,8 +78,8 @@ To define such keyword groups the attribute ``keywords`` becomes an object each
 
   {
     keywords: {
-      'keyword': 'else for if while',
-      'literal': 'false true null'
+      keyword: 'else for if while',
+      literal: 'false true null'
     }
   }
 
@@ -87,12 +87,12 @@ 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 defined by the ``lexems`` attribute:
+Different lexing rules can be defined by the ``lexemes`` attribute:
 
 ::
 
   {
-    lexems: '-[a-z]+',
+    lexemes '-[a-z]+',
     keywords: '-import -export'
   }
 
diff --git a/docs/language-requests.rst b/docs/language-requests.rst
new file mode 100644
index 0000000..4e4c2f0
--- /dev/null
+++ b/docs/language-requests.rst
@@ -0,0 +1,17 @@
+On requesting new languages
+===========================
+
+This is a general answer to requests for adding new languages that appear from
+time to time in the highlight.js issue tracker and discussion group.
+
+    Highlight.js doesn't have a fundamental plan for implementing languages,
+    instead the project works by accepting language definitions from
+    interested contributors. There are also no rules at the moment forbidding
+    any languages from being added to the library, no matter how obscure or
+    weird.
+
+    This means that there's no point in requesting a new language without
+    providing an implementation for it. If you want to see a particular language
+    included in highlight.js but cannot implement it, the best way to make it
+    happen is to get another developer interested in doing so. Here's our
+    :doc:`language-guide`.
diff --git a/docs/line-numbers.rst b/docs/line-numbers.rst
index 2ae86e2..674542d 100644
--- a/docs/line-numbers.rst
+++ b/docs/line-numbers.rst
@@ -9,7 +9,7 @@ maintainer (hey guys!):
     simplicity. Not the simplicity of code (in fact, it's quite complex) but
     the simplicity of usage and of the actual look of highlighted snippets on
     HTML pages. Many highlighters, in my opinion, are overdoing it with such
-    things as separate colors for every single type of lexems, striped
+    things as separate colors for every single type of lexemes, striped
     backgrounds, fancy buttons around code blocks and — yes — line numbers.
     The more fancy stuff resides around the code the more it distracts a
     reader from understanding it.
diff --git a/docs/reference.rst b/docs/reference.rst
index c945e01..1f45063 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -26,6 +26,22 @@ Types of attributes values in this reference:
 Attributes
 ----------
 
+case_insensitive
+^^^^^^^^^^^^^^^^
+
+**type**: boolean
+
+Case insensitivity of language keywords and regexps. Used only on the top-level mode.
+
+
+aliases
+^^^^^^^
+
+**type**: array
+
+A list of additional names (besides the canonical one given by the filename) that can be used to identify a language in HTML classes and in a call to :ref:`getLanguage <getLanguage>`.
+
+
 className
 ^^^^^^^^^
 
@@ -43,7 +59,7 @@ begin
 **type**: regexp
 
 Regular expression starting a mode. For example a single quote for strings or two forward slashes for C-style comments.
-If absent, ``begin`` defaults to ``hljs.IMMEDIATE_RE`` that matches anything.
+If absent, ``begin`` defaults to a regexp that matches anything, so the mode starts immediately.
 
 
 end
@@ -56,16 +72,16 @@ Regular expression ending a mode. For example a single quote for strings or "$"
 It's often the case that a beginning regular expression defines the entire mode and doesn't need any special ending.
 For example a number can be defined with ``begin: "\\b\\d+"`` which spans all the digits.
 
-If absent, ``end`` defaults to ``hljs.IMMEDIATE_RE`` that matches anything.
+If absent, ``end`` defaults to a regexp that matches anything, so the mode ends immediately.
 
 Sometimes a mode can end not by itself but implicitly with its containing (parent) mode.
 This is achieved with :ref:`endsWithParent <endsWithParent>` attribute.
 
 
-beginWithKeyword
+beginKeywords
 ^^^^^^^^^^^^^^^^
 
-**type**: boolean
+**type**: string
 
 Used instead of ``begin`` for modes starting with keywords to avoid needless repetition:
 
@@ -75,15 +91,17 @@ Used instead of ``begin`` for modes starting with keywords to avoid needless rep
     begin: '\\b(extends|implements) ',
     keywords: 'extends implements'
   }
-  
+
 … becomes:
 
 ::
 
   {
-    beginWithKeyword: true, keywords: 'extends implements'
+    beginKeywords: 'extends implements'
   }
 
+Unlike the ``[[#keywords]]`` attribute, this one allows only a simple list of space separated keywords. If you do need additional features of ``keywords`` or you just need more keywords for this mode you may include ``keywords`` along with ``beginKeywords``.
+
 
 .. _endsWithParent:
 
@@ -115,14 +133,14 @@ This is when ``endsWithParent`` comes into play:
   }
 
 
-.. _lexems:
+.. _lexemes:
 
-lexems
-^^^^^^
+lexemes
+^^^^^^^
 
 **type**: regexp
 
-A regular expression extracting individual lexems from language text to find ``[[#keywords]]`` among them.
+A regular expression that extracts individual lexemes from language text to find ``[[#keywords]]`` among them.
 Default value is ``hljs.IDENT_RE`` which works for most languages.
 
 
@@ -136,8 +154,7 @@ keywords
 Keyword definition comes in two forms:
 
 * ``'for while if else weird_voodoo|10 ... '`` -- a string of space-separated keywords with an optional relevance over a pipe
-* ``{'keyword': ' ... ', 'literal': ' ... '}`` -- an object whose keys are names of different kinds of keywords and values
-                                                  are keyword definition strings in the first form
+* ``{'keyword': ' ... ', 'literal': ' ... '}`` -- an object whose keys are names of different kinds of keywords and values are keyword definition strings in the first form
 
 For detailed explanation see [[Language]] definition guide.
 
@@ -147,16 +164,16 @@ illegal
 
 **type**: regexp
 
-A regular expression defining symbols illegal for the mode.
+A regular expression that defines symbols illegal for the mode.
 When the parser finds a match for illegal expression it immediately drops parsing the whole language altogether.
 
 
 excludeBegin, excludeEnd
 ^^^^^^^^^^^^^^^^^^^^^^^^
- 
+
 **type**: boolean
 
-Exclude beginning or ending lexems out of mode's generated markup. For example in CSS syntax a rule ends with a semicolon.
+Exclude beginning or ending lexemes out of mode's generated markup. For example in CSS syntax a rule ends with a semicolon.
 However visually it's better not to color it as the rule contents. Having ``excludeEnd: true`` forces a ``<span>`` element for the rule to close before the semicolon.
 
 
@@ -165,7 +182,7 @@ returnBegin
 
 **type**: boolean
 
-Returns just found beginning lexem back into parser. This is used when beginning of a sub-mode is a complex expression
+Returns just found beginning lexeme back into parser. This is used when beginning of a sub-mode is a complex expression
 that should not only be found within a parent mode but also parsed according to the rules of a sub-mode.
 
 Since the parser is effectively goes back it's quite possible to create a infinite loop here so use with caution!
@@ -176,7 +193,7 @@ returnEnd
 
 **type**: boolean
 
-Returns just found ending lexem back into parser. This is used for example to parse Javascript embedded into HTML.
+Returns just found ending lexeme back into parser. This is used for example to parse Javascript embedded into HTML.
 A Javascript block ends with the HTML closing tag ``</script>`` that cannot be parsed with Javascript rules.
 So it is returned back into its parent HTML mode that knows what to do with it.
 
@@ -202,6 +219,25 @@ Currently this attribute is used to highlight Javascript and CSS contained withi
 Tags ``<script>`` and ``<style>`` start sub-modes that use another language definition to parse their contents (see :ref:`subLanguage`).
 
 
+variants
+^^^^^^^^
+
+**type**: array
+
+Modification to the main definitions of the mode, effectively expanding it into several similar modes
+each having all the attributes from the main definition augmented or overriden by the variants::
+
+  {
+    className: 'string',
+    contains: [hljs.BACKSLASH_ESCAPE],
+    relevance: 0,
+    variants: [
+      {begin: /"/, end: /"/},
+      {begin: /'/, end: /'/, relevance: 1}
+    ]
+  }
+
+
 .. _subLanguage:
 
 subLanguage
@@ -210,9 +246,29 @@ subLanguage
 **type**: identifier
 
 The name of another language used to parse the contents of the mode.
-When using this attribute there's not point to define internal parsing rules like :ref:`lexems` or :ref:`keywords`.
+When using this attribute there's no point to define internal parsing rules like :ref:`lexemes` or :ref:`keywords`.
 Also it is recommended to skip ``className`` attribute since the sublanguage will wrap the text in its own ``<span class="language-name">``
 
 If the attribute is set to an empty string highlight.js will highlight the mode contents with language detection.
 
-Note that for this to work the language should be included in package (obviously).
+Note that for this to work the language should be included in the package (obviously).
+
+subLanguageMode
+^^^^^^^^^^^^^^^
+
+**type**: identifier
+
+The only available value for this is ``'continuous'``. By default ``subLanguage`` highlights the contents of the mode as an isolated code snippet. In continuous mode every occurance of the mode is treated as a continuation of the previous one and highlighted from the point where it was interrupted before.
+
+This is best illustrated by an example. The following snippet consists of HTML markup intermixed with some templating language::
+
+    <link href="<% url 'style.css' absolute %>" rel="stylesheet">
+
+To highlight HTML markup outside templating tags the language can be defined like this::
+
+    {
+      subLanguage: 'xml', subLanguageMode: 'continuous',
+      contains: [ ... templating tags ... ]
+    }
+
+The outside contents will be highlighted as 'xml' up to the first double quote. Then the templating tag will be highlighted according to the rules of the templating language. And after that 'xml' will restart from the previous parsing state — inside the value of a tag — and will correctly process the closing double quote and highlight the next HTML attribute.
diff --git a/src/highlight.js b/src/highlight.js
index 0438cf9..658720b 100644
--- a/src/highlight.js
+++ b/src/highlight.js
@@ -11,37 +11,43 @@ function() {
     return value.replace(/&/gm, '&').replace(/</gm, '<').replace(/>/gm, '>');
   }
 
-  function findCode(pre) {
-    for (var node = pre.firstChild; node; node = node.nextSibling) {
-      if (node.nodeName == 'CODE')
-        return node;
-      if (!(node.nodeType == 3 && node.nodeValue.match(/\s+/)))
-        break;
-    }
+  function tag(node) {
+    return node.nodeName.toLowerCase();
+  }
+
+  function testRe(re, lexeme) {
+    var match = re && re.exec(lexeme);
+    return match && match.index == 0;
   }
 
-  function blockText(block, ignoreNewLines) {
+  function blockText(block) {
     return Array.prototype.map.call(block.childNodes, function(node) {
       if (node.nodeType == 3) {
-        return ignoreNewLines ? node.nodeValue.replace(/\n/g, '') : node.nodeValue;
+        return options.useBR ? node.nodeValue.replace(/\n/g, '') : node.nodeValue;
       }
-      if (node.nodeName == 'BR') {
+      if (tag(node) == 'br') {
         return '\n';
       }
-      return blockText(node, ignoreNewLines);
+      return blockText(node);
     }).join('');
   }
 
   function blockLanguage(block) {
     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') {
-        return classes[i];
-      }
-    }
+    classes = classes.map(function(c) {return c.replace(/^language-/, '');});
+    return classes.filter(function(c) {return getLanguage(c) || c == 'no-highlight';})[0];
   }
 
+  function inherit(parent, obj) {
+    var result = {};
+    for (var key in parent)
+      result[key] = parent[key];
+    if (obj)
+      for (var key in obj)
+        result[key] = obj[key];
+    return result;
+  };
+
   /* Stream merging */
 
   function nodeStream(node) {
@@ -50,7 +56,7 @@ function() {
       for (var child = node.firstChild; child; child = child.nextSibling) {
         if (child.nodeType == 3)
           offset += child.nodeValue.length;
-        else if (child.nodeName == 'BR')
+        else if (tag(child) == 'br')
           offset += 1;
         else if (child.nodeType == 1) {
           result.push({
@@ -71,62 +77,74 @@ function() {
     return result;
   }
 
-  function mergeStreams(stream1, stream2, value) {
+  function mergeStreams(original, highlighted, value) {
     var processed = 0;
     var result = '';
     var nodeStack = [];
 
     function selectStream() {
-      if (stream1.length && stream2.length) {
-        if (stream1[0].offset != stream2[0].offset)
-          return (stream1[0].offset < stream2[0].offset) ? stream1 : stream2;
-        else {
-          /*
-          To avoid starting the stream just before it should stop the order is
-          ensured that stream1 always starts first and closes last:
-
-          if (event1 == 'start' && event2 == 'start')
-            return stream1;
-          if (event1 == 'start' && event2 == 'stop')
-            return stream2;
-          if (event1 == 'stop' && event2 == 'start')
-            return stream1;
-          if (event1 == 'stop' && event2 == 'stop')
-            return stream2;
-
-          ... which is collapsed to:
-          */
-          return stream2[0].event == 'start' ? stream1 : stream2;
-        }
-      } else {
-        return stream1.length ? stream1 : stream2;
+      if (!original.length || !highlighted.length) {
+        return original.length ? original : highlighted;
+      }
+      if (original[0].offset != highlighted[0].offset) {
+        return (original[0].offset < highlighted[0].offset) ? original : highlighted;
       }
+
+      /*
+      To avoid starting the stream just before it should stop the order is
+      ensured that original always starts first and closes last:
+
+      if (event1 == 'start' && event2 == 'start')
+        return original;
+      if (event1 == 'start' && event2 == 'stop')
+        return highlighted;
+      if (event1 == 'stop' && event2 == 'start')
+        return original;
+      if (event1 == 'stop' && event2 == 'stop')
+        return highlighted;
+
+      ... which is collapsed to:
+      */
+      return highlighted[0].event == 'start' ? original : highlighted;
     }
 
     function open(node) {
-      function attr_str(a) {return ' ' + a.nodeName + '="' + escape(a.value) + '"'};
-      return '<' + node.nodeName + Array.prototype.map.call(node.attributes, attr_str).join('') + '>';
+      function attr_str(a) {return ' ' + a.nodeName + '="' + escape(a.value) + '"';}
+      result += '<' + tag(node) + Array.prototype.map.call(node.attributes, attr_str).join('') + '>';
     }
 
-    while (stream1.length || stream2.length) {
-      var current = selectStream().splice(0, 1)[0];
-      result += escape(value.substr(processed, current.offset - processed));
-      processed = current.offset;
-      if ( current.event == 'start') {
-        result += open(current.node);
-        nodeStack.push(current.node);
-      } else if (current.event == 'stop') {
-        var node, i = nodeStack.length;
+    function close(node) {
+      result += '</' + tag(node) + '>';
+    }
+
+    function render(event) {
+      (event.event == 'start' ? open : close)(event.node);
+    }
+
+    while (original.length || highlighted.length) {
+      var stream = selectStream();
+      result += escape(value.substr(processed, stream[0].offset - processed));
+      processed = stream[0].offset;
+      if (stream == original) {
+        /*
+        On any opening or closing tag of the original markup we first close
+        the entire highlighted node stack, then render the original tag along
+        with all the following original tags at the same offset and then
+        reopen all the tags on the highlighted stack.
+        */
+        nodeStack.reverse().forEach(close);
         do {
-          i--;
-          node = nodeStack[i];
-          result += ('</' + node.nodeName.toLowerCase() + '>');
-        } while (node != current.node);
-        nodeStack.splice(i, 1);
-        while (i < nodeStack.length) {
-          result += open(nodeStack[i]);
-          i++;
+          render(stream.splice(0, 1)[0]);
+          stream = selectStream();
+        } while (stream == original && stream.length && stream[0].offset == processed);
+        nodeStack.reverse().forEach(open);
+      } else {
+        if (stream[0].event == 'start') {
+          nodeStack.push(stream[0].node);
+        } else {
+          nodeStack.pop();
         }
+        render(stream.splice(0, 1)[0]);
       }
     }
     return result + escape(value.substr(processed));
@@ -152,37 +170,40 @@ function() {
         return;
       mode.compiled = true;
 
-      var keywords = []; // used later with beginWithKeyword but filled as a side-effect of keywords compilation
+      mode.keywords = mode.keywords || mode.beginKeywords;
       if (mode.keywords) {
         var compiled_keywords = {};
 
         function flatten(className, str) {
+          if (language.case_insensitive) {
+            str = str.toLowerCase();
+          }
           str.split(' ').forEach(function(kw) {
             var pair = kw.split('|');
             compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1];
-            keywords.push(pair[0]);
           });
         }
 
-        mode.lexemsRe = langRe(mode.lexems || hljs.IDENT_RE + '(?!\\.)', true);
         if (typeof mode.keywords == 'string') { // string
-          flatten('keyword', mode.keywords)
+          flatten('keyword', mode.keywords);
         } else {
-          for (var className in mode.keywords) {
-            if (!mode.keywords.hasOwnProperty(className))
-              continue;
+          Object.keys(mode.keywords).forEach(function (className) {
             flatten(className, mode.keywords[className]);
-          }
+          });
         }
         mode.keywords = compiled_keywords;
       }
+      mode.lexemesRe = langRe(mode.lexemes || /\b[A-Za-z0-9_]+\b/, true);
+
       if (parent) {
-        if (mode.beginWithKeyword) {
-          mode.begin = '\\b(' + keywords.join('|') + ')\\b(?!\\.)\\s*';
+        if (mode.beginKeywords) {
+          mode.begin = mode.beginKeywords.split(' ').join('|');
         }
-        mode.beginRe = langRe(mode.begin ? mode.begin : '\\B|\\b');
+        if (!mode.begin)
+          mode.begin = /\B|\b/;
+        mode.beginRe = langRe(mode.begin);
         if (!mode.end && !mode.endsWithParent)
-          mode.end = '\\B|\\b';
+          mode.end = /\B|\b/;
         if (mode.end)
           mode.endRe = langRe(mode.end);
         mode.terminator_end = reStr(mode.end) || '';
@@ -196,63 +217,67 @@ function() {
       if (!mode.contains) {
         mode.contains = [];
       }
-      for (var i = 0; i < mode.contains.length; i++) {
-        if (mode.contains[i] == 'self') {
-          mode.contains[i] = mode;
+      var expanded_contains = [];
+      mode.contains.forEach(function(c) {
+        if (c.variants) {
+          c.variants.forEach(function(v) {expanded_contains.push(inherit(c, v));});
+        } else {
+          expanded_contains.push(c == 'self' ? mode : c);
         }
-        compileMode(mode.contains[i], mode);
-      }
+      });
+      mode.contains = expanded_contains;
+      mode.contains.forEach(function(c) {compileMode(c, mode);});
+
       if (mode.starts) {
         compileMode(mode.starts, parent);
       }
 
-      var terminators = [];
-      for (var i = 0; i < mode.contains.length; i++) {
-        terminators.push(reStr(mode.contains[i].begin));
-      }
-      if (mode.terminator_end) {
-        terminators.push(reStr(mode.terminator_end));
-      }
-      if (mode.illegal) {
-        terminators.push(reStr(mode.illegal));
-      }
+      var terminators =
+        mode.contains.map(function(c) {
+          return c.beginKeywords ? '\\.?\\b(' + c.begin + ')\\b\\.?' : c.begin;
+        })
+        .concat([mode.terminator_end])
+        .concat([mode.illegal])
+        .map(reStr)
+        .filter(Boolean);
       mode.terminators = terminators.length ? langRe(terminators.join('|'), true) : {exec: function(s) {return null;}};
+
+      mode.continuation = {};
     }
 
     compileMode(language);
   }
 
   /*
-  Core highlighting function. Accepts a language name and a string with the
-  code to highlight. Returns an object with the following properties:
+  Core highlighting function. Accepts a language name, or an alias, and a
+  string with the code to highlight. Returns an object with the following
+  properties:
 
   - relevance (int)
-  - keyword_count (int)
   - value (an HTML string with highlighting markup)
 
   */
-  function highlight(language_name, value, ignore_illegals) {
+  function highlight(name, value, ignore_illegals, continuation) {
 
-    function subMode(lexem, mode) {
+    function subMode(lexeme, mode) {
       for (var i = 0; i < mode.contains.length; i++) {
-        var match = mode.contains[i].beginRe.exec(lexem);
-        if (match && match.index == 0) {
+        if (testRe(mode.contains[i].beginRe, lexeme)) {
           return mode.contains[i];
         }
       }
     }
 
-    function endOfMode(mode, lexem) {
-      if (mode.end && mode.endRe.test(lexem)) {
+    function endOfMode(mode, lexeme) {
+      if (testRe(mode.endRe, lexeme)) {
         return mode;
       }
       if (mode.endsWithParent) {
-        return endOfMode(mode.parent, lexem);
+        return endOfMode(mode.parent, lexeme);
       }
     }
 
-    function isIllegal(lexem, mode) {
-      return !ignore_illegals && mode.illegal && mode.illegalRe.test(lexem);
+    function isIllegal(lexeme, mode) {
+      return !ignore_illegals && testRe(mode.illegalRe, lexeme);
     }
 
     function keywordMatch(mode, match) {
@@ -260,25 +285,35 @@ function() {
       return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];
     }
 
+    function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {
+      var classPrefix = noPrefix ? '' : options.classPrefix,
+          openSpan    = '<span class="' + classPrefix,
+          closeSpan   = leaveOpen ? '' : '</span>';
+
+      openSpan += classname + '">';
+
+      return openSpan + insideSpan + closeSpan;
+    }
+
     function processKeywords() {
       var buffer = escape(mode_buffer);
       if (!top.keywords)
         return buffer;
       var result = '';
       var last_index = 0;
-      top.lexemsRe.lastIndex = 0;
-      var match = top.lexemsRe.exec(buffer);
+      top.lexemesRe.lastIndex = 0;
+      var match = top.lexemesRe.exec(buffer);
       while (match) {
         result += buffer.substr(last_index, match.index - last_index);
         var keyword_match = keywordMatch(top, match);
         if (keyword_match) {
-          keyword_count += keyword_match[1];
-          result += '<span class="'+ keyword_match[0] +'">' + match[0] + '</span>';
+          relevance += keyword_match[1];
+          result += buildSpan(keyword_match[0], match[0]);
         } else {
           result += match[0];
         }
-        last_index = top.lexemsRe.lastIndex;
-        match = top.lexemsRe.exec(buffer);
+        last_index = top.lexemesRe.lastIndex;
+        match = top.lexemesRe.exec(buffer);
       }
       return result + buffer.substr(last_index);
     }
@@ -287,56 +322,59 @@ function() {
       if (top.subLanguage && !languages[top.subLanguage]) {
         return escape(mode_buffer);
       }
-      var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer) : highlightAuto(mode_buffer);
+      var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, top.continuation.top) : highlightAuto(mode_buffer);
       // Counting embedded language score towards the host language may be disabled
       // with zeroing the containing mode relevance. Usecase in point is Markdown that
       // allows XML everywhere and makes every XML snippet to have a much larger Markdown
       // score.
       if (top.relevance > 0) {
-        keyword_count += result.keyword_count;
         relevance += result.relevance;
       }
-      return '<span class="' + result.language  + '">' + result.value + '</span>';
+      if (top.subLanguageMode == 'continuous') {
+        top.continuation.top = result.top;
+      }
+      return buildSpan(result.language, result.value, false, true);
     }
 
     function processBuffer() {
       return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();
     }
 
-    function startNewMode(mode, lexem) {
-      var markup = mode.className? '<span class="' + mode.className + '">': '';
+    function startNewMode(mode, lexeme) {
+      var markup = mode.className? buildSpan(mode.className, '', true): '';
       if (mode.returnBegin) {
         result += markup;
         mode_buffer = '';
       } else if (mode.excludeBegin) {
-        result += escape(lexem) + markup;
+        result += escape(lexeme) + markup;
         mode_buffer = '';
       } else {
         result += markup;
-        mode_buffer = lexem;
+        mode_buffer = lexeme;
       }
       top = Object.create(mode, {parent: {value: top}});
     }
 
-    function processLexem(buffer, lexem) {
+    function processLexeme(buffer, lexeme) {
+
       mode_buffer += buffer;
-      if (lexem === undefined) {
+      if (lexeme === undefined) {
         result += processBuffer();
         return 0;
       }
 
-      var new_mode = subMode(lexem, top);
+      var new_mode = subMode(lexeme, top);
       if (new_mode) {
         result += processBuffer();
-        startNewMode(new_mode, lexem);
-        return new_mode.returnBegin ? 0 : lexem.length;
+        startNewMode(new_mode, lexeme);
+        return new_mode.returnBegin ? 0 : lexeme.length;
       }
 
-      var end_mode = endOfMode(top, lexem);
+      var end_mode = endOfMode(top, lexeme);
       if (end_mode) {
         var origin = top;
         if (!(origin.returnEnd || origin.excludeEnd)) {
-          mode_buffer += lexem;
+          mode_buffer += lexeme;
         }
         result += processBuffer();
         do {
@@ -347,34 +385,42 @@ function() {
           top = top.parent;
         } while (top != end_mode.parent);
         if (origin.excludeEnd) {
-          result += escape(lexem);
+          result += escape(lexeme);
         }
         mode_buffer = '';
         if (end_mode.starts) {
           startNewMode(end_mode.starts, '');
         }
-        return origin.returnEnd ? 0 : lexem.length;
+        return origin.returnEnd ? 0 : lexeme.length;
       }
 
-      if (isIllegal(lexem, top))
-        throw new Error('Illegal lexem "' + lexem + '" for mode "' + (top.className || '<unnamed>') + '"');
+      if (isIllegal(lexeme, top))
+        throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '<unnamed>') + '"');
 
       /*
-      Parser should not reach this point as all types of lexems should be caught
+      Parser should not reach this point as all types of lexemes should be caught
       earlier, but if it does due to some bug make sure it advances at least one
       character forward to prevent infinite looping.
       */
-      mode_buffer += lexem;
-      return lexem.length || 1;
+      mode_buffer += lexeme;
+      return lexeme.length || 1;
+    }
+
+    var language = getLanguage(name);
+    if (!language) {
+      throw new Error('Unknown language: "' + name + '"');
     }
 
-    var language = languages[language_name];
     compileLanguage(language);
-    var top = language;
+    var top = continuation || language;
+    var result = '';
+    for(var current = top; current != language; current = current.parent) {
+      if (current.className) {
+        result = buildSpan(current.className, result, true);
+      }
+    }
     var mode_buffer = '';
     var relevance = 0;
-    var keyword_count = 0;
-    var result = '';
     try {
       var match, count, index = 0;
       while (true) {
@@ -382,21 +428,25 @@ function() {
         match = top.terminators.exec(value);
         if (!match)
           break;
-        count = processLexem(value.substr(index, match.index - index), match[0]);
+        count = processLexeme(value.substr(index, match.index - index), match[0]);
         index = match.index + count;
       }
-      processLexem(value.substr(index))
+      processLexeme(value.substr(index));
+      for(var current = top; current.parent; current = current.parent) { // close dangling modes
+        if (current.className) {
+          result += '</span>';
+        }
+      };
       return {
         relevance: relevance,
-        keyword_count: keyword_count,
         value: result,
-        language: language_name
+        language: name,
+        top: top
       };
     } catch (e) {
       if (e.message.indexOf('Illegal') != -1) {
         return {
           relevance: 0,
-          keyword_count: 0,
           value: escape(value)
         };
       } else {
@@ -411,32 +461,32 @@ function() {
 
   - language (detected language)
   - relevance (int)
-  - keyword_count (int)
   - value (an HTML string with highlighting markup)
   - second_best (object with the same structure for second-best heuristically
     detected language, may be absent)
 
   */
-  function highlightAuto(text) {
+  function highlightAuto(text, languageSubset) {
+    languageSubset = languageSubset || options.languages || Object.keys(languages);
     var result = {
-      keyword_count: 0,
       relevance: 0,
       value: escape(text)
     };
     var second_best = result;
-    for (var key in languages) {
-      if (!languages.hasOwnProperty(key))
-        continue;
-      var current = highlight(key, text, false);
-      current.language = key;
-      if (current.keyword_count + current.relevance > second_best.keyword_count + second_best.relevance) {
+    languageSubset.forEach(function(name) {
+      if (!getLanguage(name)) {
+        return;
+      }
+      var current = highlight(name, text, false);
+      current.language = name;
+      if (current.relevance > second_best.relevance) {
         second_best = current;
       }
-      if (current.keyword_count + current.relevance > result.keyword_count + result.relevance) {
+      if (current.relevance > result.relevance) {
         second_best = result;
         result = current;
       }
-    }
+    });
     if (second_best.language) {
       result.second_best = second_best;
     }
@@ -450,13 +500,13 @@ function() {
   - replace real line-breaks with '<br>' for non-pre containers
 
   */
-  function fixMarkup(value, tabReplace, useBR) {
-    if (tabReplace) {
+  function fixMarkup(value) {
+    if (options.tabReplace) {
       value = value.replace(/^((<[^>]+>|\t)+)/gm, function(match, p1, offset, s) {
-        return p1.replace(/\t/g, tabReplace);
+        return p1.replace(/\t/g, options.tabReplace);
       });
     }
-    if (useBR) {
+    if (options.useBR) {
       value = value.replace(/\n/g, '<br>');
     }
     return value;
@@ -466,41 +516,48 @@ function() {
   Applies highlighting to a DOM node containing code. Accepts a DOM node and
   two optional parameters for fixMarkup.
   */
-  function highlightBlock(block, tabReplace, useBR) {
-    var text = blockText(block, useBR);
+  function highlightBlock(block) {
+    var text = blockText(block);
     var language = blockLanguage(block);
     if (language == 'no-highlight')
         return;
     var result = language ? highlight(language, text, true) : highlightAuto(text);
-    language = result.language;
     var original = nodeStream(block);
     if (original.length) {
-      var pre = document.createElement('pre');
+      var pre = document.createElementNS('http://www.w3.org/1999/xhtml', 'pre');
       pre.innerHTML = result.value;
       result.value = mergeStreams(original, nodeStream(pre), text);
     }
-    result.value = fixMarkup(result.value, tabReplace, useBR);
+    result.value = fixMarkup(result.value);
 
-    var class_name = block.className;
-    if (!class_name.match('(\\s|^)(language-)?' + language + '(\\s|$)')) {
-      class_name = class_name ? (class_name + ' ' + language) : language;
-    }
     block.innerHTML = result.value;
-    block.className = class_name;
+    block.className += ' hljs ' + (!language && result.language || '');
     block.result = {
-      language: language,
-      kw: result.keyword_count,
+      language: result.language,
       re: result.relevance
     };
     if (result.second_best) {
       block.second_best = {
         language: result.second_best.language,
-        kw: result.second_best.keyword_count,
         re: result.second_best.relevance
       };
     }
   }
 
+  var options = {
+    classPrefix: 'hljs-',
+    tabReplace: null,
+    useBR: false,
+    languages: undefined
+  };
+
+  /*
+  Updates highlight.js global options with values passed in the form of an object
+  */
+  function configure(user_options) {
+    options = inherit(options, user_options);
+  }
+
   /*
   Applies highlighting to all <pre><code>..</code></pre> blocks on a page.
   */
@@ -508,30 +565,45 @@ function() {
     if (initHighlighting.called)
       return;
     initHighlighting.called = true;
-    Array.prototype.map.call(document.getElementsByTagName('pre'), findCode).
-      filter(Boolean).
-      forEach(function(code){highlightBlock(code, hljs.tabReplace)});
+
+    var blocks = document.querySelectorAll('pre code');
+    Array.prototype.forEach.call(blocks, highlightBlock);
   }
 
   /*
   Attaches highlighting to the page load event.
   */
   function initHighlightingOnLoad() {
-    window.addEventListener('DOMContentLoaded', initHighlighting, false);
-    window.addEventListener('load', initHighlighting, false);
+    addEventListener('DOMContentLoaded', initHighlighting, false);
+    addEventListener('load', initHighlighting, false);
   }
 
-  var languages = {}; // a shortcut to avoid writing "this." everywhere
+  var languages = {};
+  var aliases = {};
+
+  function registerLanguage(name, language) {
+    var lang = languages[name] = language(this);
+    if (lang.aliases) {
+      lang.aliases.forEach(function(alias) {aliases[alias] = name;});
+    }
+  }
+
+  function getLanguage(name) {
+    return languages[name] || languages[aliases[name]];
+  }
 
   /* Interface definition */
 
-  this.LANGUAGES = languages;
   this.highlight = highlight;
   this.highlightAuto = highlightAuto;
   this.fixMarkup = fixMarkup;
   this.highlightBlock = highlightBlock;
+  this.configure = configure;
   this.initHighlighting = initHighlighting;
   this.initHighlightingOnLoad = initHighlightingOnLoad;
+  this.registerLanguage = registerLanguage;
+  this.getLanguage = getLanguage;
+  this.inherit = inherit;
 
   // Common regexps
   this.IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*';
@@ -539,7 +611,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 = {
@@ -549,15 +621,13 @@ function() {
     className: 'string',
     begin: '\'', end: '\'',
     illegal: '\\n',
-    contains: [this.BACKSLASH_ESCAPE],
-    relevance: 0
+    contains: [this.BACKSLASH_ESCAPE]
   };
   this.QUOTE_STRING_MODE = {
     className: 'string',
     begin: '"', end: '"',
     illegal: '\\n',
-    contains: [this.BACKSLASH_ESCAPE],
-    relevance: 0
+    contains: [this.BACKSLASH_ESCAPE]
   };
   this.C_LINE_COMMENT_MODE = {
     className: 'comment',
@@ -598,16 +668,15 @@ function() {
         contains: [this.BACKSLASH_ESCAPE]
       }
     ]
-  }
-
-  // Utility functions
-  this.inherit = function(parent, obj) {
-    var result = {}
-    for (var key in parent)
-      result[key] = parent[key];
-    if (obj)
-      for (var key in obj)
-        result[key] = obj[key];
-    return result;
-  }
+  };
+  this.TITLE_MODE = {
+    className: 'title',
+    begin: this.IDENT_RE,
+    relevance: 0
+  };
+  this.UNDERSCORE_TITLE_MODE = {
+    className: 'title',
+    begin: this.UNDERSCORE_IDENT_RE,
+    relevance: 0
+  };
 }
diff --git a/src/languages/1c.js b/src/languages/1c.js
index 177fb1f..5828563 100644
--- a/src/languages/1c.js
+++ b/src/languages/1c.js
@@ -38,8 +38,7 @@ function(hljs){
   var STR_START = {
       className: 'string',
       begin: '"', end: '"|$',
-      contains: [DQUOTE],
-      relevance: 0
+      contains: [DQUOTE]
     };
   var STR_CONT = {
     className: 'string',
@@ -49,7 +48,7 @@ function(hljs){
 
   return {
     case_insensitive: true,
-    lexems: IDENT_RE_RU,
+    lexemes: IDENT_RE_RU,
     keywords: {keyword: OneS_KEYWORDS, built_in: OneS_BUILT_IN},
     contains: [
       hljs.C_LINE_COMMENT_MODE,
@@ -58,10 +57,10 @@ function(hljs){
       {
         className: 'function',
         begin: '(процедура|функция)', end: '$',
-        lexems: IDENT_RE_RU,
+        lexemes: IDENT_RE_RU,
         keywords: 'процедура функция',
         contains: [
-          {className: 'title', begin: IDENT_RE_RU},
+          hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE_RU}),
           {
             className: 'tail',
             endsWithParent: true,
@@ -69,14 +68,14 @@ function(hljs){
               {
                 className: 'params',
                 begin: '\\(', end: '\\)',
-                lexems: IDENT_RE_RU,
+                lexemes: IDENT_RE_RU,
                 keywords: 'знач',
                 contains: [STR_START, STR_CONT]
               },
               {
                 className: 'export',
                 begin: 'экспорт', endsWithParent: true,
-                lexems: IDENT_RE_RU,
+                lexemes: IDENT_RE_RU,
                 keywords: 'экспорт',
                 contains: [hljs.C_LINE_COMMENT_MODE]
               }
diff --git a/src/languages/actionscript.js b/src/languages/actionscript.js
index f0ec37d..82b082c 100644
--- a/src/languages/actionscript.js
+++ b/src/languages/actionscript.js
@@ -12,7 +12,6 @@ function(hljs) {
     begin: '[.]{3}', end: IDENT_RE,
     relevance: 10
   };
-  var TITLE_MODE = {className: 'title', begin: IDENT_RE};
 
   return {
     keywords: {
@@ -31,34 +30,29 @@ function(hljs) {
       hljs.C_NUMBER_MODE,
       {
         className: 'package',
-        beginWithKeyword: true, end: '{',
-        keywords: 'package',
-        contains: [TITLE_MODE]
+        beginKeywords: 'package', end: '{',
+        contains: [hljs.TITLE_MODE]
       },
       {
         className: 'class',
-        beginWithKeyword: true, end: '{',
-        keywords: 'class interface',
+        beginKeywords: 'class interface', end: '{',
         contains: [
           {
-            beginWithKeyword: true,
-            keywords: 'extends implements'
+            beginKeywords: 'extends implements'
           },
-          TITLE_MODE
+          hljs.TITLE_MODE
         ]
       },
       {
         className: 'preprocessor',
-        beginWithKeyword: true, end: ';',
-        keywords: 'import include'
+        beginKeywords: 'import include', end: ';'
       },
       {
         className: 'function',
-        beginWithKeyword: true, end: '[{;]',
-        keywords: 'function',
+        beginKeywords: 'function', end: '[{;]',
         illegal: '\\S',
         contains: [
-          TITLE_MODE,
+          hljs.TITLE_MODE,
           {
             className: 'params',
             begin: '\\(', end: '\\)',
diff --git a/src/languages/apache.js b/src/languages/apache.js
index 8b80d68..38de0e6 100644
--- a/src/languages/apache.js
+++ b/src/languages/apache.js
@@ -1,117 +1,52 @@
 /*
 Language: Apache
 Author: Ruslan Keba <rukeba at gmail.com>
+Contributors: Ivan Sagalaev <maniac at softwaremaniacs.org>
 Website: http://rukeba.com/
 Description: language definition for Apache configuration files (httpd.conf & .htaccess)
-Version: 1.1
-Date: 2008-12-27
 */
 
 function(hljs) {
   var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
   return {
     case_insensitive: true,
-    keywords: {
-      keyword: 'acceptfilter acceptmutex acceptpathinfo accessfilename action addalt ' +
-        'addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription ' +
-        'addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter ' +
-        'addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias ' +
-        'aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous ' +
-        'anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail ' +
-        'authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery ' +
-        'authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative ' +
-        'authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat ' +
-        'authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize ' +
-        'authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig ' +
-        'authldapcomparednonserver authldapdereferencealiases authldapgroupattribute ' +
-        'authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn ' +
-        'authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative ' +
-        'authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative ' +
-        'authzldapauthoritative authzownerauthoritative authzuserauthoritative ' +
-        'balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire ' +
-        'cachedirlength cachedirlevels cachedisable cacheenable cachefile ' +
-        'cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod ' +
-        'cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize ' +
-        'cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate ' +
-        'cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly ' +
-        'checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog ' +
-        'cookiename cookiestyle cookietracking coredumpdirectory customlog dav ' +
-        'davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep ' +
-        'dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon ' +
-        'defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel ' +
-        'deflatefilternote deflatememlevel deflatewindowsize deny directoryindex ' +
-        'directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput ' +
-        'enableexceptionhook enablemmap enablesendfile errordocument errorlog example ' +
-        'expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine ' +
-        'extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider ' +
-        'filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout ' +
-        'group header headername hostnamelookups identitycheck identitychecktimeout ' +
-        'imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions ' +
-        'indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery ' +
-        'isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive ' +
-        'keepalivetimeout languagepriority ldapcacheentries ldapcachettl ' +
-        'ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ' +
-        'ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ' +
-        'ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields ' +
-        'limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog ' +
-        'loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests ' +
-        'maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads ' +
-        'maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer ' +
-        'mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix ' +
-        'mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on ' +
-        'mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk ' +
-        'mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size ' +
-        'mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include ' +
-        'mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate ' +
-        'mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary ' +
-        'mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy ' +
-        'nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho ' +
-        'proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset ' +
-        'proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv ' +
-        'proxypassmatch proxypassreverse proxypassreversecookiedomain ' +
-        'proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote ' +
-        'proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia ' +
-        'readmename receivebuffersize redirect redirectmatch redirectpermanent ' +
-        'redirecttemp removecharset removeencoding removehandler removeinputfilter ' +
-        'removelanguage removeoutputfilter removetype requestheader require rewritebase ' +
-        'rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap ' +
-        'rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile ' +
-        'script scriptalias scriptaliasmatch scriptinterpretersource scriptlog ' +
-        'scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail ' +
-        'sendbuffersize serveradmin serveralias serverlimit servername serverpath ' +
-        'serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler ' +
-        'setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ' +
-        'ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath ' +
-        'sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath ' +
-        'sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite ' +
-        'sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions ' +
-        'sslpassphrasedialog sslprotocol sslproxycacertificatefile ' +
-        'sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath ' +
-        'sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile ' +
-        'sslproxymachinecertificatepath sslproxyprotocol sslproxyverify ' +
-        'sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache ' +
-        'sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers ' +
-        'startthreads substitute suexecusergroup threadlimit threadsperchild ' +
-        'threadstacksize timeout traceenable transferlog typesconfig unsetenv ' +
-        'usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot ' +
-        'virtualdocumentrootip virtualscriptalias virtualscriptaliasip ' +
-        'win32disableacceptex xbithack',
-      literal: 'on off'
-    },
     contains: [
       hljs.HASH_COMMENT_MODE,
-      {
-        className: 'sqbracket',
-        begin: '\\s\\[', end: '\\]$'
-      },
-      {
-        className: 'cbracket',
-        begin: '[\\$%]\\{', end: '\\}',
-        contains: ['self', NUMBER]
-      },
-      NUMBER,
       {className: 'tag', begin: '</?', end: '>'},
-      hljs.QUOTE_STRING_MODE
-    ]
+      {
+        className: 'keyword',
+        begin: /\w+/,
+        relevance: 0,
+        // keywords aren’t needed for highlighting per se, they only boost relevance
+        // for a very generally defined mode (starts with a word, ends with line-end
+        keywords: {
+          common:
+            'order deny allow setenv rewriterule rewriteengine rewritecond documentroot ' +
+            'sethandler errordocument loadmodule options header listen serverroot ' +
+            'servername'
+        },
+        starts: {
+          end: /$/,
+          relevance: 0,
+          keywords: {
+            literal: 'on off all'
+          },
+          contains: [
+            {
+              className: 'sqbracket',
+              begin: '\\s\\[', end: '\\]$'
+            },
+            {
+              className: 'cbracket',
+              begin: '[\\$%]\\{', end: '\\}',
+              contains: ['self', NUMBER]
+            },
+            NUMBER,
+            hljs.QUOTE_STRING_MODE
+          ]
+        }
+      }
+    ],
+    illegal: /\S/
   };
 }
diff --git a/src/languages/applescript.js b/src/languages/applescript.js
index b8240df..5607c46 100644
--- a/src/languages/applescript.js
+++ b/src/languages/applescript.js
@@ -6,9 +6,6 @@ Authors: Nathan Grigg <nathan at nathanamy.org>
 
 function(hljs) {
   var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: ''});
-  var TITLE = {
-    className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
-  };
   var PARAMS = {
     className: 'params',
     begin: '\\(', end: '\\)',
@@ -93,10 +90,9 @@ function(hljs) {
       },
       {
         className: 'function_start',
-        beginWithKeyword: true,
-        keywords: 'on',
+        beginKeywords: 'on',
         illegal: '[${=;\\n]',
-        contains: [TITLE, PARAMS]
+        contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS]
       }
     ].concat(COMMENTS),
     illegal: '//'
diff --git a/src/languages/asciidoc.js b/src/languages/asciidoc.js
index f0538ce..72a3af4 100644
--- a/src/languages/asciidoc.js
+++ b/src/languages/asciidoc.js
@@ -136,6 +136,18 @@ function(hljs) {
         end: '(\\n{2}|_)',
         relevance: 0
       },
+      // inline double smart quotes
+      {
+        className: 'smartquote',
+        begin: "``.+?''",
+        relevance: 10
+      },
+      // inline single smart quotes
+      {
+        className: 'smartquote',
+        begin: "`.+?'",
+        relevance: 10
+      },
       // inline code snippets (TODO should get same treatment as strong and emphasis)
       {
         className: 'code',
@@ -152,7 +164,7 @@ function(hljs) {
       // horizontal rules
       {
         className: 'horizontal_rule',
-        begin: '^\'{4,}[ \\t]*$',
+        begin: '^\'{3,}[ \\t]*$',
         relevance: 10
       },
       // images and links
diff --git a/src/languages/autohotkey.js b/src/languages/autohotkey.js
new file mode 100644
index 0000000..7c073f4
--- /dev/null
+++ b/src/languages/autohotkey.js
@@ -0,0 +1,65 @@
+/*
+Language: AutoHotkey
+Author: Seongwon Lee <dlimpid at gmail.com>
+Description: AutoHotkey language definition
+*/
+
+function(hljs) {
+  var BACKTICK_ESCAPE = {
+    className: 'escape',
+    begin: '`[\\s\\S]'
+  };
+  var COMMENTS = {
+    className: 'comment',
+    begin: ';', end: '$',
+    relevance: 0
+  };
+  var BUILT_IN = [
+    {
+      className: 'built_in',
+      begin: 'A_[a-zA-Z0-9]+'
+    },
+    {
+      className: 'built_in',
+      beginKeywords: 'ComSpec Clipboard ClipboardAll ErrorLevel'
+    }
+  ];
+
+  return {
+    case_insensitive: true,
+    keywords: {
+      keyword: 'Break Continue Else Gosub If Loop Return While',
+      literal: 'A true false NOT AND OR'
+    },
+    contains: BUILT_IN.concat([
+      BACKTICK_ESCAPE,
+      hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [BACKTICK_ESCAPE]}),
+      COMMENTS,
+      {
+        className: 'number',
+        begin: hljs.NUMBER_RE,
+        relevance: 0
+      },
+      {
+        className: 'var_expand', // FIXME
+        begin: '%', end: '%',
+        illegal: '\\n',
+        contains: [BACKTICK_ESCAPE]
+      },
+      {
+        className: 'label',
+        contains: [BACKTICK_ESCAPE],
+        variants: [
+          {begin: '^[^\\n";]+::(?!=)'},
+          {begin: '^[^\\n";]+:(?!=)', relevance: 0} // zero relevance as it catches a lot of things
+                                                    // followed by a single ':' in many languages
+        ]
+      },
+      {
+        // consecutive commas, not for highlighting but just for relevance
+        begin: ',\\s*,',
+        relevance: 10
+      }
+    ])
+  }
+}
diff --git a/src/languages/avrasm.js b/src/languages/avrasm.js
index 040e7df..50b9df0 100644
--- a/src/languages/avrasm.js
+++ b/src/languages/avrasm.js
@@ -32,7 +32,7 @@ function(hljs) {
     },
     contains: [
       hljs.C_BLOCK_COMMENT_MODE,
-      {className: 'comment', begin: ';',  end: '$'},
+      {className: 'comment', begin: ';',  end: '$', relevance: 0},
       hljs.C_NUMBER_MODE, // 0x..., decimal, float
       hljs.BINARY_NUMBER_MODE, // 0b...
       {
diff --git a/src/languages/axapta.js b/src/languages/axapta.js
index 549853e..cc09e8c 100644
--- a/src/languages/axapta.js
+++ b/src/languages/axapta.js
@@ -23,20 +23,15 @@ function(hljs) {
       },
       {
         className: 'class',
-        beginWithKeyword: true, end: '{',
+        beginKeywords: 'class interface', end: '{',
         illegal: ':',
-        keywords: 'class interface',
         contains: [
           {
             className: 'inheritance',
-            beginWithKeyword: true,
-            keywords: 'extends implements',
+            beginKeywords: 'extends implements',
             relevance: 10
           },
-          {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE
-          }
+          hljs.UNDERSCORE_TITLE_MODE
         ]
       }
     ]
diff --git a/src/languages/bash.js b/src/languages/bash.js
index 89e58f1..73e4ab8 100644
--- a/src/languages/bash.js
+++ b/src/languages/bash.js
@@ -5,35 +5,33 @@ Contributrors: Benjamin Pannell <contact at sierrasoftworks.com>
 */
 
 function(hljs) {
-  var VAR1 = {
-    className: 'variable', begin: /\$[\w\d#@][\w\d_]*/
-  };
-  var VAR2 = {
-    className: 'variable', begin: /\$\{(.*?)\}/
+  var VAR = {
+    className: 'variable',
+    variants: [
+      {begin: /\$[\w\d#@][\w\d_]*/},
+      {begin: /\$\{(.*?)\}/}
+    ]
   };
   var QUOTE_STRING = {
     className: 'string',
     begin: /"/, end: /"/,
     contains: [
       hljs.BACKSLASH_ESCAPE,
-      VAR1,
-      VAR2,
+      VAR,
       {
         className: 'variable',
         begin: /\$\(/, end: /\)/,
-        contains: hljs.BACKSLASH_ESCAPE
+        contains: [hljs.BACKSLASH_ESCAPE]
       }
-    ],
-    relevance: 0
+    ]
   };
   var APOS_STRING = {
     className: 'string',
-    begin: /'/, end: /'/,
-    relevance: 0
+    begin: /'/, end: /'/
   };
 
   return {
-    lexems: /-?[a-z]+/,
+    lexemes: /-?[a-z\.]+/,
     keywords: {
       keyword:
         'if then else elif fi for break continue while in do done exit return set '+
@@ -56,15 +54,14 @@ function(hljs) {
         className: 'function',
         begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
         returnBegin: true,
-        contains: [{className: 'title', begin: /\w[\w\d_]*/}],
+        contains: [hljs.inherit(hljs.TITLE_MODE, {begin: /\w[\w\d_]*/})],
         relevance: 0
       },
       hljs.HASH_COMMENT_MODE,
       hljs.NUMBER_MODE,
       QUOTE_STRING,
       APOS_STRING,
-      VAR1,
-      VAR2
+      VAR
     ]
   };
 }
diff --git a/src/languages/brainfuck.js b/src/languages/brainfuck.js
index 905afd1..0bafd44 100644
--- a/src/languages/brainfuck.js
+++ b/src/languages/brainfuck.js
@@ -4,12 +4,17 @@ Author: Evgeny Stepanischev <imbolk at gmail.com>
 */
 
 function(hljs){
+  var LITERAL = {
+    className: 'literal',
+    begin: '[\\+\\-]',
+    relevance: 0
+  };
   return {
     contains: [
       {
         className: 'comment',
         begin: '[^\\[\\]\\.,\\+\\-<> \r\n]',
-        excludeEnd: true,
+        returnEnd: true,
         end: '[\\[\\]\\.,\\+\\-<> \r\n]',
         relevance: 0
       },
@@ -20,12 +25,15 @@ function(hljs){
       },
       {
         className: 'string',
-        begin: '[\\.,]'
+        begin: '[\\.,]',
+        relevance: 0
       },
       {
-        className: 'literal',
-        begin: '[\\+\\-]'
-      }
+        // this mode works as the only relevance counter
+        begin: /\+\+|\-\-/, returnBegin: true,
+        contains: [LITERAL]
+      },
+      LITERAL
     ]
   };
 }
diff --git a/src/languages/clojure.js b/src/languages/clojure.js
index 67c410b..2d080f7 100644
--- a/src/languages/clojure.js
+++ b/src/languages/clojure.js
@@ -19,17 +19,17 @@ function(hljs) {
       'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends '+
       'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler '+
       'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter '+
-      'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for doseq dosync dotimes and or '+
+      'monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or '+
       'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert '+
       'peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast '+
       'sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import '+
-      'intern refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+
-      'assoc! dissoc! pop! disj! import use class type num float double short byte boolean bigint biginteger '+
-      'bigdec print-method print-dup throw-if throw printf format load compile get-in update-in pr pr-on newline '+
-      'flush read slurp read-line subvec with-open memfn time ns assert re-find re-groups rand-int rand mod locking '+
-      'assert-valid-fdecl alias namespace resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+
+      'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! '+
+      'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger '+
+      'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline '+
+      'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking '+
+      'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! '+
       'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! '+
-      'new next conj set! memfn to-array future future-call into-array aset gen-class reduce merge map filter find empty '+
+      'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty '+
       'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list '+
       'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer '+
       'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate '+
@@ -44,12 +44,7 @@ function(hljs) {
     className: 'number', begin: SIMPLE_NUMBER_RE,
     relevance: 0
   };
-  var STRING = {
-    className: 'string',
-    begin: '"', end: '"',
-    contains: [hljs.BACKSLASH_ESCAPE],
-    relevance: 0
-  };
+  var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
   var COMMENT = {
     className: 'comment',
     begin: ';', end: '$',
@@ -66,6 +61,7 @@ function(hljs) {
   var HINT_COL = {
     className: 'comment',
     begin: '\\^\\{', end: '\\}'
+
   };
   var KEY = {
     className: 'attribute',
@@ -82,20 +78,25 @@ function(hljs) {
   };
   var TITLE = {
     keywords: keywords,
-    lexems: CLJ_IDENT_RE,
+    lexemes: CLJ_IDENT_RE,
     className: 'title', begin: CLJ_IDENT_RE,
     starts: BODY
   };
 
-  LIST.contains = [{className: 'comment', begin: 'comment'}, TITLE];
+  LIST.contains = [{className: 'comment', begin: 'comment'}, TITLE, BODY];
   BODY.contains = [LIST, STRING, HINT, HINT_COL, COMMENT, KEY, COLLECTION, NUMBER];
   COLLECTION.contains = [LIST, STRING, HINT, COMMENT, KEY, COLLECTION, NUMBER];
 
   return {
-    illegal: '\\S',
+    illegal: /\S/,
     contains: [
       COMMENT,
-      LIST
+      LIST,
+      {
+        className: 'prompt',
+        begin: /^=> /,
+        starts: {end: /\n\n|\Z/} // eat up prompt output to not interfere with the illegal
+      }
     ]
   }
 }
diff --git a/src/languages/cmake.js b/src/languages/cmake.js
index 8966297..4a11054 100644
--- a/src/languages/cmake.js
+++ b/src/languages/cmake.js
@@ -1,30 +1,36 @@
 /*
 Language: CMake
 Description: CMake is an open-source cross-platform system for build automation.
-Author: Igor Kalnitsky <igor.kalnitsky at gmail.com>
-Website: http://kalnitsky.org.ua/
+Author: Igor Kalnitsky <igor at kalnitsky.org>
+Website: http://kalnitsky.org/
 */
 
 function(hljs) {
   return {
     case_insensitive: true,
-    keywords: 'add_custom_command add_custom_target add_definitions add_dependencies ' +
-      'add_executable add_library add_subdirectory add_test aux_source_directory ' +
-      'break build_command cmake_minimum_required cmake_policy configure_file ' +
-      'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
-      'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
-      'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
-      'get_cmake_property get_directory_property get_filename_component get_property ' +
-      'get_source_file_property get_target_property get_test_property if include ' +
-      'include_directories include_external_msproject include_regular_expression install ' +
-      'link_directories load_cache load_command macro mark_as_advanced message option ' +
-      'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
-      'separate_arguments set set_directory_properties set_property ' +
-      'set_source_files_properties set_target_properties set_tests_properties site_name ' +
-      'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
-      'while build_name exec_program export_library_dependencies install_files ' +
-      'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
-      'subdirs use_mangled_mesa utility_source variable_requires write_file',
+    keywords: {
+      keyword:
+        'add_custom_command add_custom_target add_definitions add_dependencies ' +
+        'add_executable add_library add_subdirectory add_test aux_source_directory ' +
+        'break build_command cmake_minimum_required cmake_policy configure_file ' +
+        'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
+        'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
+        'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
+        'get_cmake_property get_directory_property get_filename_component get_property ' +
+        'get_source_file_property get_target_property get_test_property if include ' +
+        'include_directories include_external_msproject include_regular_expression install ' +
+        'link_directories load_cache load_command macro mark_as_advanced message option ' +
+        'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
+        'separate_arguments set set_directory_properties set_property ' +
+        'set_source_files_properties set_target_properties set_tests_properties site_name ' +
+        'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
+        'while build_name exec_program export_library_dependencies install_files ' +
+        'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
+        'subdirs use_mangled_mesa utility_source variable_requires write_file ' +
+        'qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or',
+      operator:
+        'equal less greater strless strgreater strequal matches'
+    },
     contains: [
       {
         className: 'envvar',
diff --git a/src/languages/coffeescript.js b/src/languages/coffeescript.js
old mode 100755
new mode 100644
index 64ab522..45addba
--- a/src/languages/coffeescript.js
+++ b/src/languages/coffeescript.js
@@ -25,54 +25,52 @@ function(hljs) {
       '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};
+  var TITLE = hljs.inherit(hljs.TITLE_MODE, {begin: JS_IDENT_RE});
   var SUBST = {
     className: 'subst',
-    begin: '#\\{', end: '}',
-    keywords: KEYWORDS,
+    begin: /#\{/, end: /}/,
+    keywords: KEYWORDS
   };
   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
+      variants: [
+        {
+          begin: /'''/, end: /'''/,
+          contains: [hljs.BACKSLASH_ESCAPE]
+        },
+        {
+          begin: /'/, end: /'/,
+          contains: [hljs.BACKSLASH_ESCAPE]
+        },
+        {
+          begin: /"""/, end: /"""/,
+          contains: [hljs.BACKSLASH_ESCAPE, SUBST]
+        },
+        {
+          begin: /"/, end: /"/,
+          contains: [hljs.BACKSLASH_ESCAPE, SUBST]
+        }
+      ]
     },
     {
       className: 'regexp',
-      begin: '/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)' // \S is required to parse x / 2 / 3 as two divisions
+      variants: [
+        {
+          begin: '///', end: '///',
+          contains: [SUBST, hljs.HASH_COMMENT_MODE]
+        },
+        {
+          begin: '//[gim]*',
+          relevance: 0
+        },
+        {
+          begin: '/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)' // \S is required to parse x / 2 / 3 as two divisions
+        }
+      ]
     },
-
     {
       className: 'property',
       begin: '@' + JS_IDENT_RE
@@ -95,7 +93,7 @@ function(hljs) {
       hljs.HASH_COMMENT_MODE,
       {
         className: 'function',
-        begin: '(' + JS_IDENT_RE + '\\s*=\\s*)?(\\(.*\\))?\\s*[-=]>', end: '[-=]>',
+        begin: '(' + JS_IDENT_RE + '\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>', end: '[-=]>',
         returnBegin: true,
         contains: [
           TITLE,
@@ -114,14 +112,14 @@ function(hljs) {
       },
       {
         className: 'class',
-        beginWithKeyword: true, keywords: 'class',
+        beginKeywords: 'class',
         end: '$',
-        illegal: '[:\\[\\]]',
+        illegal: /[:="\[\]]/,
         contains: [
           {
-            beginWithKeyword: true, keywords: 'extends',
+            beginKeywords: 'extends',
             endsWithParent: true,
-            illegal: ':',
+            illegal: /[:="\[\]]/,
             contains: [TITLE]
           },
           TITLE
@@ -130,7 +128,8 @@ function(hljs) {
       {
         className: 'attribute',
         begin: JS_IDENT_RE + ':', end: ':',
-        returnBegin: true, excludeEnd: true
+        returnBegin: true, excludeEnd: true,
+        relevance: 0
       }
     ])
   };
diff --git a/src/languages/cpp.js b/src/languages/cpp.js
index a6b8c28..8ccd8b6 100644
--- a/src/languages/cpp.js
+++ b/src/languages/cpp.js
@@ -1,6 +1,7 @@
 /*
 Language: C++
-Contributors: Evgeny Stepanischev <imbolk at gmail.com>
+Author: Ivan Sagalaev <maniac at softwaremaniacs.org>
+Contributors: Evgeny Stepanischev <imbolk at gmail.com>, Zaven Muradyan <megalivoithos at gmail.com>
 */
 
 function(hljs) {
@@ -11,12 +12,19 @@ function(hljs) {
       'do return goto auto void enum else break new extern using true class asm case typeid ' +
       'short reinterpret_cast|10 default double register explicit signed typename try this ' +
       'switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype ' +
-      'noexcept nullptr static_assert thread_local restrict _Bool complex',
+      'noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary',
     built_in: 'std string cin cout cerr clog stringstream istringstream ostringstream ' +
       'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
-      'unordered_map unordered_multiset unordered_multimap array shared_ptr'
+      'unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos ' +
+      'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +
+      'fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +
+      'isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow ' +
+      'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +
+      'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +
+      'vfprintf vprintf vsprintf'
   };
   return {
+    aliases: ['c'],
     keywords: CPP_KEYWORDS,
     illegal: '</',
     contains: [
@@ -37,7 +45,7 @@ function(hljs) {
         className: 'preprocessor',
         begin: '#', end: '$',
         contains: [
-          {begin: '<', end: '>', illegal: '\\n'},
+          {begin: 'include\\s*<', end: '>', illegal: '\\n'},
           hljs.C_LINE_COMMENT_MODE
         ]
       },
diff --git a/src/languages/cs.js b/src/languages/cs.js
index 1f1ee78..6ef82db 100644
--- a/src/languages/cs.js
+++ b/src/languages/cs.js
@@ -4,18 +4,19 @@ Author: Jason Diamond <jason at diamond.name>
 */
 
 function(hljs) {
+  var KEYWORDS =
+    // Normal keywords.
+    'abstract as base bool break byte case catch char checked const continue decimal ' +
+    'default delegate do double else enum event explicit extern false finally fixed float ' +
+    'for foreach goto if implicit in int interface internal is lock long 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 async await ' +
+    // Contextual keywords.
+    'ascending descending from get group into join let orderby partial select set value var ' +
+    'where yield';
   return {
-    keywords:
-      // Normal keywords.
-      'abstract as base bool break byte case catch char checked class const continue decimal ' +
-      'default delegate do double else enum event explicit extern false finally fixed float ' +
-      '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 async await ' +
-      // Contextual keywords.
-      'ascending descending from get group into join let orderby partial select set value var '+
-      'where yield',
+    keywords: KEYWORDS,
     contains: [
       {
         className: 'comment',
@@ -45,7 +46,25 @@ function(hljs) {
       },
       hljs.APOS_STRING_MODE,
       hljs.QUOTE_STRING_MODE,
-      hljs.C_NUMBER_MODE
+      hljs.C_NUMBER_MODE,
+      {
+        beginKeywords: 'protected public private internal', end: /[{;=]/,
+        keywords: KEYWORDS,
+        contains: [
+          {
+            beginKeywords: 'class namespace interface',
+            starts: {
+              contains: [hljs.TITLE_MODE]
+            }
+          },
+          {
+            begin: hljs.IDENT_RE + '\\s*\\(', returnBegin: true,
+            contains: [
+              hljs.TITLE_MODE
+            ]
+          }
+        ]
+      }
     ]
   };
 }
diff --git a/src/languages/css.js b/src/languages/css.js
index 2ea58ff..22c5326 100644
--- a/src/languages/css.js
+++ b/src/languages/css.js
@@ -33,7 +33,7 @@ function(hljs) {
       {
         className: 'at_rule',
         begin: '@(font-face|page)',
-        lexems: '[a-z-]+',
+        lexemes: '[a-z-]+',
         keywords: 'font-face page'
       },
       {
diff --git a/src/languages/d.js b/src/languages/d.js
index 78aa35c..45abef6 100644
--- a/src/languages/d.js
+++ b/src/languages/d.js
@@ -148,8 +148,7 @@ function(hljs) {
 		className: 'string',
 		begin: '"',
 		contains: [D_ESCAPE_SEQUENCE],
-		end: '"[cwd]?',
-		relevance: 0
+		end: '"[cwd]?'
 	};
 
 	/**
@@ -245,7 +244,7 @@ function(hljs) {
 	}
 
 	return {
-		lexems: hljs.UNDERSCORE_IDENT_RE,
+		lexemes: hljs.UNDERSCORE_IDENT_RE,
 		keywords: D_KEYWORDS,
 		contains: [
 			hljs.C_LINE_COMMENT_MODE,
diff --git a/src/languages/delphi.js b/src/languages/delphi.js
index 915b38b..3cb989c 100644
--- a/src/languages/delphi.js
+++ b/src/languages/delphi.js
@@ -3,75 +3,60 @@ Language: Delphi
 */
 
 function(hljs) {
-  var DELPHI_KEYWORDS = 'and safecall cdecl then string exports library not pascal set ' +
-    'virtual file in array label packed end. index while const raise for to implementation ' +
-    'with except overload destructor downto finally program exit unit inherited override if ' +
-    'type until function do begin repeat goto nil far initialization object else var uses ' +
-    'external resourcestring interface end finalization class asm mod case on shr shl of ' +
-    'register xorwrite threadvar try record near stored constructor stdcall inline div out or ' +
-    'procedure';
-  var DELPHI_CLASS_KEYWORDS = 'safecall stdcall pascal stored const implementation ' +
-    'finalization except to finally program inherited override then exports string read not ' +
-    'mod shr try div shl set library message packed index for near overload label downto exit ' +
-    'public goto interface asm on of constructor or private array unit raise destructor var ' +
-    'type until function else external with case default record while protected property ' +
-    'procedure published and cdecl do threadvar file in if end virtual write far out begin ' +
-    'repeat nil initialization object uses resourcestring class register xorwrite inline static';
-  var CURLY_COMMENT =  {
+  var KEYWORDS =
+    'exports register file shl array record property for mod while set ally label uses raise not ' +
+    'stored class safecall var interface or private static exit index inherited to else stdcall ' +
+    'override shr asm far resourcestring finalization packed virtual out and protected library do ' +
+    'xorwrite goto near function end div overload object unit begin string on inline repeat until ' +
+    'destructor write message program with read initialization except default nil if case cdecl in ' +
+    'downto threadvar of try pascal const external constructor type public then implementation ' +
+    'finally published procedure';
+  var COMMENT =  {
     className: 'comment',
-    begin: '{', end: '}',
-    relevance: 0
-  };
-  var PAREN_COMMENT = {
-    className: 'comment',
-    begin: '\\(\\*', end: '\\*\\)',
-    relevance: 10
+    variants: [
+      {begin: /\{/, end: /\}/, relevance: 0},
+      {begin: /\(\*/, end: /\*\)/, relevance: 10}
+    ]
   };
   var STRING = {
     className: 'string',
-    begin: '\'', end: '\'',
-    contains: [{begin: '\'\''}],
-    relevance: 0
+    begin: /'/, end: /'/,
+    contains: [{begin: /''/}]
   };
   var CHAR_STRING = {
-    className: 'string', begin: '(#\\d+)+'
+    className: 'string', begin: /(#\d+)+/
+  };
+  var CLASS = {
+    begin: hljs.IDENT_RE + '\\s*=\\s*class\\s*\\(', returnBegin: true,
+    contains: [
+      hljs.TITLE_MODE
+    ]
   };
   var FUNCTION = {
     className: 'function',
-    beginWithKeyword: true, end: '[:;]',
+    beginKeywords: 'function constructor destructor procedure', end: /[:;]/,
     keywords: 'function constructor|10 destructor|10 procedure|10',
     contains: [
-      {
-        className: 'title', begin: hljs.IDENT_RE
-      },
+      hljs.TITLE_MODE,
       {
         className: 'params',
-        begin: '\\(', end: '\\)',
-        keywords: DELPHI_KEYWORDS,
+        begin: /\(/, end: /\)/,
+        keywords: KEYWORDS,
         contains: [STRING, CHAR_STRING]
       },
-      CURLY_COMMENT, PAREN_COMMENT
+      COMMENT
     ]
   };
   return {
     case_insensitive: true,
-    keywords: DELPHI_KEYWORDS,
-    illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
+    keywords: KEYWORDS,
+    illegal: /("|\$[G-Zg-z]|\/\*|<\/)/,
     contains: [
-      CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
+      COMMENT, hljs.C_LINE_COMMENT_MODE,
       STRING, CHAR_STRING,
       hljs.NUMBER_MODE,
-      FUNCTION,
-      {
-        className: 'class',
-        begin: '=\\bclass\\b', end: 'end;',
-        keywords: DELPHI_CLASS_KEYWORDS,
-        contains: [
-          STRING, CHAR_STRING,
-          CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
-          FUNCTION
-        ]
-      }
+      CLASS,
+      FUNCTION
     ]
   };
 }
diff --git a/src/languages/diff.js b/src/languages/diff.js
index 515be40..6b1eecf 100644
--- a/src/languages/diff.js
+++ b/src/languages/diff.js
@@ -9,42 +9,23 @@ function(hljs) {
     contains: [
       {
         className: 'chunk',
-        begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$',
-        relevance: 10
-      },
-      {
-        className: 'chunk',
-        begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$',
-        relevance: 10
-      },
-      {
-        className: 'chunk',
-        begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$',
-        relevance: 10
-      },
-      {
-        className: 'header',
-        begin: 'Index: ', end: '$'
-      },
-      {
-        className: 'header',
-        begin: '=====', end: '=====$'
-      },
-      {
-        className: 'header',
-        begin: '^\\-\\-\\-', end: '$'
-      },
-      {
-        className: 'header',
-        begin: '^\\*{3} ', end: '$'
-      },
-      {
-        className: 'header',
-        begin: '^\\+\\+\\+', end: '$'
+        relevance: 10,
+        variants: [
+          {begin: /^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},
+          {begin: /^\*\*\* +\d+,\d+ +\*\*\*\*$/},
+          {begin: /^\-\-\- +\d+,\d+ +\-\-\-\-$/}
+        ]
       },
       {
         className: 'header',
-        begin: '\\*{5}', end: '\\*{5}$'
+        variants: [
+          {begin: /Index: /, end: /$/},
+          {begin: /=====/, end: /=====$/},
+          {begin: /^\-\-\-/, end: /$/},
+          {begin: /^\*{3} /, end: /$/},
+          {begin: /^\+\+\+/, end: /$/},
+          {begin: /\*{5}/, end: /\*{5}$/}
+        ]
       },
       {
         className: 'addition',
diff --git a/src/languages/django.js b/src/languages/django.js
index 4e54a8a..d571fb6 100644
--- a/src/languages/django.js
+++ b/src/languages/django.js
@@ -6,38 +6,9 @@ Contributors: Ilya Baryshev <baryshev at gmail.com>
 */
 
 function(hljs) {
-
-  function allowsDjangoSyntax(mode, parent) {
-    return (
-      parent == undefined || // default mode
-      (!mode.className && parent.className == 'tag') || // tag_internal
-      mode.className == 'value' // value
-    );
-  }
-
-  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));
-      }
-      if (allowsDjangoSyntax(mode, parent)) {
-        contains = DJANGO_CONTAINS.concat(contains);
-      }
-      if (contains.length) {
-        result.contains = contains;
-      }
-    }
-    return result;
-  }
-
   var FILTER = {
     className: 'filter',
-    begin: '\\|[A-Za-z]+\\:?',
+    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 ' +
@@ -48,42 +19,43 @@ function(hljs) {
       'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
       'localtime utc timezone',
     contains: [
-      {className: 'argument', begin: '"', end: '"'}
+      {className: 'argument', begin: /"/, end: /"/},
+      {className: 'argument', begin: /'/, end: /'/}
     ]
   };
 
-  var DJANGO_CONTAINS = [
-    {
-      className: 'template_comment',
-      begin: '{%\\s*comment\\s*%}', end: '{%\\s*endcomment\\s*%}'
-    },
-    {
-      className: 'template_comment',
-      begin: '{#', end: '#}'
-    },
-    {
-      className: 'template_tag',
-      begin: '{%', end: '%}',
-      keywords:
-        'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
-        'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
-        'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
-        'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
-        '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 ' +
-        'verbatim',
-      contains: [FILTER]
-    },
-    {
-      className: 'variable',
-      begin: '{{', end: '}}',
-      contains: [FILTER]
-    }
-  ];
-
-  var result = copy(hljs.LANGUAGES.xml);
-  result.case_insensitive = true;
-  return result;
+  return {
+    case_insensitive: true,
+    subLanguage: 'xml', subLanguageMode: 'continuous',
+    contains: [
+      {
+        className: 'template_comment',
+        begin: /\{%\s*comment\s*%}/, end: /\{%\s*endcomment\s*%}/
+      },
+      {
+        className: 'template_comment',
+        begin: /\{#/, end: /#}/
+      },
+      {
+        className: 'template_tag',
+        begin: /\{%/, end: /%}/,
+        keywords:
+          'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
+          'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
+          'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
+          'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
+          '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 ' +
+          'verbatim',
+        contains: [FILTER]
+      },
+      {
+        className: 'variable',
+        begin: /\{\{/, end: /}}/,
+        contains: [FILTER]
+      }
+    ]
+  };
 }
diff --git a/src/languages/erlang.js b/src/languages/erlang.js
index 1c9c33f..caa18c4 100644
--- a/src/languages/erlang.js
+++ b/src/languages/erlang.js
@@ -62,8 +62,7 @@ function(hljs) {
     relevance: 0
   };
   var RECORD_ACCESS = {
-    begin: '#', end: '}',
-    illegal: '.',
+    begin: '#' + hljs.UNDERSCORE_IDENT_RE,
     relevance: 0,
     returnBegin: true,
     contains: [
@@ -73,7 +72,7 @@ function(hljs) {
         relevance: 0
       },
       {
-        begin: '{', endsWithParent: true,
+        begin: '{', end: '}',
         relevance: 0
         // "contains" defined later
       }
@@ -81,8 +80,8 @@ function(hljs) {
   };
 
   var BLOCK_STATEMENTS = {
-    keywords: ERLANG_RESERVED,
-    begin: '(fun|receive|if|try|case)', end: 'end'
+    beginKeywords: 'fun receive if try case', end: 'end',
+    keywords: ERLANG_RESERVED
   };
   BLOCK_STATEMENTS.contains = [
     COMMENT,
@@ -125,12 +124,10 @@ function(hljs) {
         className: 'function',
         begin: '^' + BASIC_ATOM_RE + '\\s*\\(', end: '->',
         returnBegin: true,
-        illegal: '\\(|#|//|/\\*|\\\\|:',
+        illegal: '\\(|#|//|/\\*|\\\\|:|;',
         contains: [
           PARAMS,
-          {
-            className: 'title', begin: BASIC_ATOM_RE
-          }
+          hljs.inherit(hljs.TITLE_MODE, {begin: BASIC_ATOM_RE})
         ],
         starts: {
           end: ';|\\.',
@@ -145,7 +142,7 @@ function(hljs) {
         relevance: 0,
         excludeEnd: true,
         returnBegin: true,
-        lexems: '-' + hljs.IDENT_RE,
+        lexemes: '-' + hljs.IDENT_RE,
         keywords:
           '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +
           '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +
diff --git a/src/languages/fix.js b/src/languages/fix.js
new file mode 100644
index 0000000..2ab582d
--- /dev/null
+++ b/src/languages/fix.js
@@ -0,0 +1,33 @@
+/*
+Language: FIX
+Author: Brent Bradbury <brent at brentium.com>
+*/
+
+function(hljs) {
+  return {
+    contains: [
+    {
+      begin: /[^\u2401\u0001]+/,
+      end: /[\u2401\u0001]/,
+      excludeEnd: true,
+      returnBegin: true,
+      returnEnd: false,
+      contains: [
+      {
+        begin: /([^\u2401\u0001=]+)/,
+        end: /=([^\u2401\u0001=]+)/,
+        returnEnd: true,
+        returnBegin: false,
+        className: 'attribute'
+      },
+      {
+        begin: /=/,
+        end: /([\u2401\u0001])/,
+        excludeEnd: true,
+        excludeBegin: true,
+        className: 'string'
+      }]
+    }],
+    case_insensitive: true
+  };
+}
diff --git a/src/languages/fsharp.js b/src/languages/fsharp.js
index 754dfcf..913632e 100644
--- a/src/languages/fsharp.js
+++ b/src/languages/fsharp.js
@@ -1,6 +1,7 @@
 /*
 Language: F#
 Author: Jonas Follesø <jonas at follesoe.no>
+Contributors: Troy Kershaw <hello at troykershaw.com>
 Description: F# language definition.
 */
 function(hljs) {
@@ -25,30 +26,25 @@ function(hljs) {
       },
       {
         className: 'comment',
-        begin: '//', end: '$', returnBegin: true
-      },
-      {
-        className: 'comment',
         begin: '\\(\\*', end: '\\*\\)'
       },
       {
         className: 'class',
-        beginWithKeyword: true, end: '\\(|=|$',
-        keywords: 'type',
+        beginKeywords: 'type', end: '\\(|=|$',
         contains: [
-          {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE
-          }
+          hljs.UNDERSCORE_TITLE_MODE
         ]
       },
       {
         className: 'annotation',
         begin: '\\[<', end: '>\\]'
       },
+      {
+        className: 'attribute',
+        begin: '\\B(\'[A-Za-z])\\b',
+        contains: [hljs.BACKSLASH_ESCAPE]
+      },
       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/go.js b/src/languages/go.js
index 4c1f133..27f2220 100644
--- a/src/languages/go.js
+++ b/src/languages/go.js
@@ -19,6 +19,7 @@ function(hljs) {
       'append cap close complex copy imag len make new panic print println real recover delete'
   };
   return {
+    aliases: ["golang"],
     keywords: GO_KEYWORDS,
     illegal: '</',
     contains: [
@@ -27,8 +28,7 @@ function(hljs) {
       hljs.QUOTE_STRING_MODE,
       {
         className: 'string',
-        begin: '\'', end: '[^\\\\]\'',
-        relevance: 0
+        begin: '\'', end: '[^\\\\]\''
       },
       {
         className: 'string',
diff --git a/src/languages/haml.js b/src/languages/haml.js
index 43b4616..6d18f7b 100644
--- a/src/languages/haml.js
+++ b/src/languages/haml.js
@@ -18,16 +18,15 @@ function(hljs) {
       {
         className: 'comment',
         // FIXME these comments should be allowed to span indented lines
-        begin: '^\\s*(-#|/).*$',
+        begin: '^\\s*(!=#|=#|-#|/).*$',
         relevance: 0
       },
       {
-        begin: '^\\s*-(?!#)',
+        begin: '^\\s*(-|=|!=)(?!#)',
         starts: {
           end: '\\n',
           subLanguage: 'ruby'
-        },
-        relevance: 0
+        }
       },
       {
         className: 'tag',
@@ -35,13 +34,11 @@ function(hljs) {
         contains: [
           {
             className: 'title',
-            begin: '\\w+',
-            relevance: 0
+            begin: '\\w+'
           },
           {
             className: 'value',
-            begin: '[#\\.]\\w+',
-            relevance: 0
+            begin: '[#\\.]\\w+'
           },
           {
             begin: '{\\s*',
@@ -54,33 +51,28 @@ function(hljs) {
                 end: ',\\s+',
                 returnBegin: true,
                 endsWithParent: true,
-                relevance: 0,
                 contains: [
                   {
                     className: 'symbol',
-                    begin: ':\\w+',
-                    relevance: 0
+                    begin: ':\\w+'
                   },
                   {
                     className: 'string',
                     begin: '"',
-                    end: '"',
-                    relevance: 0
+                    end: '"'
                   },
                   {
                     className: 'string',
                     begin: '\'',
-                    end: '\'',
-                    relevance: 0
+                    end: '\''
                   },
                   {
                     begin: '\\w+',
                     relevance: 0
                   }
                 ]
-              },
-            ],
-            relevance: 0
+              }
+            ]
           },
           {
             begin: '\\(\\s*',
@@ -93,7 +85,6 @@ function(hljs) {
                 end: '\\s+',
                 returnBegin: true,
                 endsWithParent: true,
-                relevance: 0,
                 contains: [
                   {
                     className: 'attribute',
@@ -103,14 +94,12 @@ function(hljs) {
                   {
                     className: 'string',
                     begin: '"',
-                    end: '"',
-                    relevance: 0
+                    end: '"'
                   },
                   {
                     className: 'string',
                     begin: '\'',
-                    end: '\'',
-                    relevance: 0
+                    end: '\''
                   },
                   {
                     begin: '\\w+',
@@ -118,11 +107,9 @@ function(hljs) {
                   }
                 ]
               },
-            ],
-            relevance: 0
+            ]
           }
-        ],
-        relevance: 10
+        ]
       },
       {
         className: 'bullet',
@@ -134,8 +121,7 @@ function(hljs) {
         starts: {
           end: '}',
           subLanguage: 'ruby'
-        },
-        relevance: 0
+        }
       }
     ]
   };
diff --git a/src/languages/handlebars.js b/src/languages/handlebars.js
index 73d2a15..e468006 100644
--- a/src/languages/handlebars.js
+++ b/src/languages/handlebars.js
@@ -6,59 +6,33 @@ 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));
+  var EXPRESSION_KEYWORDS = 'each in with if else unless bindattr action collection debugger log outlet template unbound view yield';
+  return {
+    case_insensitive: true,
+    subLanguage: 'xml', subLanguageMode: 'continuous',
+    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
+          }
+        ]
       }
-      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 da11423..be9beb8 100644
--- a/src/languages/haskell.js
+++ b/src/languages/haskell.js
@@ -1,89 +1,129 @@
 /*
 Language: Haskell
 Author: Jeremy Hull <sourdrums at gmail.com>
+Contributors: Zena Treep <zena.treep at gmail.com>
 */
 
 function(hljs) {
-  var TYPE = {
+
+  var COMMENT = {
+    className: 'comment',
+    variants: [
+      { begin: '--', end: '$' },
+      { begin: '{-', end: '-}'
+      , contains: ['self']
+      }
+    ]
+  };
+
+  var PRAGMA = {
+    className: 'pragma',
+    begin: '{-#', end: '#-}'
+  };
+
+  var PREPROCESSOR = {
+    className: 'preprocessor',
+    begin: '^#', end: '$'
+  };
+
+  var CONSTRUCTOR = {
     className: 'type',
-    begin: '\\b[A-Z][\\w\']*',
+    begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (build-in, infix).
     relevance: 0
   };
-  var CONTAINER = {
+
+  var LIST = {
     className: 'container',
     begin: '\\(', end: '\\)',
     illegal: '"',
     contains: [
+      PRAGMA,
+      COMMENT,
+      PREPROCESSOR,
       {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
-      {className: 'title', begin: '[_a-z][\\w\']*'}
+      hljs.inherit(hljs.TITLE_MODE, {begin: '[_a-z][\\w\']*'})
     ]
   };
-  var CONTAINER2 = {
+
+  var RECORD = {
     className: 'container',
     begin: '{', end: '}',
-    contains: CONTAINER.contains
-  }
+    contains: LIST.contains
+  };
 
   return {
     keywords:
-      'let in if then else case of where do module import hiding qualified type data ' +
-      'newtype deriving class instance not as foreign ccall safe unsafe',
+      'let in if then else case of where do module import hiding ' +
+      'qualified type data newtype deriving class instance as default ' +
+      'infix infixl infixr foreign export ccall stdcall cplusplus ' +
+      'jvm dotnet safe unsafe family forall mdo proc rec',
     contains: [
+
+      // Top-level constructions.
+
       {
-        className: 'comment',
-        begin: '--', end: '$'
-      },
-      {
-        className: 'preprocessor',
-        begin: '{-#', end: '#-}'
+        className: 'module',
+        begin: '\\bmodule\\b', end: 'where',
+        keywords: 'module where',
+        contains: [LIST, COMMENT],
+        illegal: '\\W\\.|;'
       },
       {
-        className: 'comment',
-        contains: ['self'],
-        begin: '{-', end: '-}'
+        className: 'import',
+        begin: '\\bimport\\b', end: '$',
+        keywords: 'import|0 qualified as hiding',
+        contains: [LIST, COMMENT],
+        illegal: '\\W\\.|;'
       },
+
       {
-        className: 'string',
-        begin: '\\s+\'', end: '\'',
-        contains: [hljs.BACKSLASH_ESCAPE],
-        relevance: 0
+        className: 'class',
+        begin: '^(\\s*)?(class|instance)\\b', end: 'where',
+        keywords: 'class family instance where',
+        contains: [CONSTRUCTOR, LIST, COMMENT]
       },
-      hljs.QUOTE_STRING_MODE,
       {
-        className: 'import',
-        begin: '\\bimport', end: '$',
-        keywords: 'import qualified as hiding',
-        contains: [CONTAINER],
-        illegal: '\\W\\.|;'
+        className: 'typedef',
+        begin: '\\b(data|(new)?type)\\b', end: '$',
+        keywords: 'data family type newtype deriving',
+        contains: [PRAGMA, COMMENT, CONSTRUCTOR, LIST, RECORD]
       },
       {
-        className: 'module',
-        begin: '\\bmodule', end: 'where',
-        keywords: 'module where',
-        contains: [CONTAINER],
-        illegal: '\\W\\.|;'
+        className: 'default',
+        beginKeywords: 'default', end: '$',
+        contains: [CONSTRUCTOR, LIST, COMMENT]
       },
       {
-        className: 'class',
-        begin: '\\b(class|instance)', end: 'where',
-        keywords: 'class where instance',
-        contains: [TYPE]
+        className: 'infix',
+        beginKeywords: 'infix infixl infixr', end: '$',
+        contains: [hljs.C_NUMBER_MODE, COMMENT]
       },
       {
-        className: 'typedef',
-        begin: '\\b(data|(new)?type)', end: '$',
-        keywords: 'data type newtype deriving',
-        contains: [TYPE, CONTAINER, CONTAINER2]
+        className: 'foreign',
+        begin: '\\bforeign\\b', end: '$',
+        keywords: 'foreign import export ccall stdcall cplusplus jvm ' +
+                  'dotnet safe unsafe',
+        contains: [CONSTRUCTOR, hljs.QUOTE_STRING_MODE, COMMENT]
       },
-      hljs.C_NUMBER_MODE,
       {
         className: 'shebang',
         begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
       },
-      TYPE,
-      {
-        className: 'title', begin: '^[_a-z][\\w\']*'
-      },
+
+      // "Whitespaces".
+
+      PRAGMA,
+      COMMENT,
+      PREPROCESSOR,
+
+      // Literals and names.
+
+      // TODO: characters.
+      hljs.QUOTE_STRING_MODE,
+      hljs.C_NUMBER_MODE,
+      CONSTRUCTOR,
+      hljs.inherit(hljs.TITLE_MODE, {begin: '^[_a-z][\\w\']*'}),
+
       {begin: '->|<-'} // No markup, relevance booster
     ]
   };
diff --git a/src/languages/ini.js b/src/languages/ini.js
index c576be0..63cc607 100644
--- a/src/languages/ini.js
+++ b/src/languages/ini.js
@@ -5,7 +5,7 @@ Language: Ini
 function(hljs) {
   return {
     case_insensitive: true,
-    illegal: '[^\\s]',
+    illegal: /\S/,
     contains: [
       {
         className: 'comment',
diff --git a/src/languages/java.js b/src/languages/java.js
index d973695..e4763b8 100644
--- a/src/languages/java.js
+++ b/src/languages/java.js
@@ -4,12 +4,14 @@ Author: Vsevolod Solovyov <vsevolod.solovyov at gmail.com>
 */
 
 function(hljs) {
+  var KEYWORDS =
+    'false synchronized int abstract float private char boolean static null if const ' +
+    'for true while long throw strictfp finally protected import native final return void ' +
+    'enum else break transient new catch instanceof byte super volatile case assert short ' +
+    'package default double public try this switch continue throws';
   return {
-    keywords:
-      'false synchronized int abstract float private char boolean static null if const ' +
-      'for true while long throw strictfp finally protected import native final return void ' +
-      'enum else break transient new catch instanceof byte super volatile case assert short ' +
-      'package default double public try this switch continue throws',
+    keywords: KEYWORDS,
+    illegal: /<\//,
     contains: [
       {
         className: 'javadoc',
@@ -24,20 +26,26 @@ function(hljs) {
       hljs.APOS_STRING_MODE,
       hljs.QUOTE_STRING_MODE,
       {
-        className: 'class',
-        beginWithKeyword: true, end: '{',
-        keywords: 'class interface',
-        excludeEnd: true,
-        illegal: ':',
+        beginKeywords: 'protected public private', end: /[{;=]/,
+        keywords: KEYWORDS,
         contains: [
           {
-            beginWithKeyword: true,
-            keywords: 'extends implements',
-            relevance: 10
+            className: 'class',
+            beginKeywords: 'class interface', endsWithParent: true,
+            illegal: /[:"<>]/,
+            contains: [
+              {
+                beginKeywords: 'extends implements',
+                relevance: 10
+              },
+              hljs.UNDERSCORE_TITLE_MODE
+            ]
           },
           {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE
+            begin: hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true,
+            contains: [
+              hljs.UNDERSCORE_TITLE_MODE
+            ]
           }
         ]
       },
diff --git a/src/languages/javascript.js b/src/languages/javascript.js
index a0e87a5..8dd0a7a 100644
--- a/src/languages/javascript.js
+++ b/src/languages/javascript.js
@@ -4,15 +4,28 @@ Language: JavaScript
 
 function(hljs) {
   return {
+    aliases: ['js'],
     keywords: {
       keyword:
         'in if for while finally var new function do return void else break catch ' +
         'instanceof with throw case default try this switch continue typeof delete ' +
-        'let yield const',
+        'let yield const class',
       literal:
-        'true false null undefined NaN Infinity'
+        'true false null undefined NaN Infinity',
+      built_in:
+        'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
+        'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
+        'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
+        'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
+        'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
+        'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require'
     },
     contains: [
+      {
+        className: 'pi',
+        begin: /^\s*('|")use strict('|")/,
+        relevance: 10
+      },
       hljs.APOS_STRING_MODE,
       hljs.QUOTE_STRING_MODE,
       hljs.C_LINE_COMMENT_MODE,
@@ -27,6 +40,7 @@ function(hljs) {
           hljs.REGEXP_MODE,
           { // E4X
             begin: /</, end: />;/,
+            relevance: 0,
             subLanguage: 'xml'
           }
         ],
@@ -34,12 +48,9 @@ function(hljs) {
       },
       {
         className: 'function',
-        beginWithKeyword: true, end: /{/,
-        keywords: 'function',
+        beginKeywords: 'function', end: /\{/,
         contains: [
-          {
-            className: 'title', begin: /[A-Za-z$_][0-9A-Za-z$_]*/
-          },
+          hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][0-9A-Za-z$_]*/}),
           {
             className: 'params',
             begin: /\(/, end: /\)/,
@@ -51,6 +62,12 @@ function(hljs) {
           }
         ],
         illegal: /\[|%/
+      },
+      {
+        begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
+      },
+      {
+        begin: '\\.' + hljs.IDENT_RE, relevance: 0 // hack: prevents detection of keywords after dots
       }
     ]
   };
diff --git a/src/languages/lasso.js b/src/languages/lasso.js
index 60a97de..9a6ad91 100644
--- a/src/languages/lasso.js
+++ b/src/languages/lasso.js
@@ -5,64 +5,169 @@ Description: Lasso is a language and server platform for database-driven web app
 */
 
 function(hljs) {
-  var LASSO_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*|&[lg]t;';
-  var LASSO_START = '<\\?(lasso(script)?|=)';
+  var LASSO_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*';
+  var LASSO_ANGLE_RE = '<\\?(lasso(script)?|=)';
+  var LASSO_CLOSE_RE = '\\]|\\?>';
+  var LASSO_KEYWORDS = {
+    literal:
+      'true false none minimal full all void and or not ' +
+      'bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft',
+    built_in:
+      'array date decimal duration integer map pair string tag xml null ' +
+      'bytes list queue set stack staticarray tie local var variable ' +
+      'global data self inherited',
+    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 returnhome ' +
+      'skip split_thread sum take thread to trait type where with ' +
+      'yield yieldhome'
+  };
+  var HTML_COMMENT = {
+    className: 'comment',
+    begin: '<!--', end: '-->',
+    relevance: 0
+  };
+  var LASSO_NOPROCESS = {
+    className: 'preprocessor',
+    begin: '\\[noprocess\\]',
+    starts: {
+      className: 'markup',
+      end: '\\[/noprocess\\]',
+      returnEnd: true,
+      contains: [ HTML_COMMENT ]
+    }
+  };
+  var LASSO_START = {
+    className: 'preprocessor',
+    begin: '\\[/noprocess|' + LASSO_ANGLE_RE
+  };
+  var LASSO_DATAMEMBER = {
+    className: 'variable',
+    begin: '\'' + LASSO_IDENT_RE + '\''
+  };
+  var LASSO_CODE = [
+    hljs.C_LINE_COMMENT_MODE,
+    {
+      className: 'javadoc',
+      begin: '/\\*\\*!', end: '\\*/'
+    },
+    hljs.C_BLOCK_COMMENT_MODE,
+    hljs.inherit(hljs.C_NUMBER_MODE, {begin: hljs.C_NUMBER_RE + '|-?(infinity|nan)\\b'}),
+    hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
+    hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
+    {
+      className: 'string',
+      begin: '`', end: '`'
+    },
+    {
+      className: 'variable',
+      variants: [
+        {
+          begin: '[#$]' + LASSO_IDENT_RE
+        },
+        {
+          begin: '#', end: '\\d+',
+          illegal: '\\W'
+        }
+      ]
+    },
+    {
+      className: 'tag',
+      begin: '::\\s*', end: LASSO_IDENT_RE,
+      illegal: '\\W'
+    },
+    {
+      className: 'attribute',
+      begin: '\\.\\.\\.|-' + hljs.UNDERSCORE_IDENT_RE
+    },
+    {
+      className: 'subst',
+      variants: [
+        {
+          begin: '->\\s*',
+          contains: [ LASSO_DATAMEMBER ]
+        },
+        {
+          begin: ':=|/(?!\\w)=?|[-+*%=<>&|!?\\\\]+',
+          relevance: 0
+        }
+      ]
+    },
+    {
+      className: 'built_in',
+      begin: '\\.\\.?',
+      relevance: 0,
+      contains: [ LASSO_DATAMEMBER ]
+    },
+    {
+      className: 'class',
+      beginKeywords: 'define',
+      returnEnd: true, end: '\\(|=>',
+      contains: [
+        hljs.inherit(hljs.TITLE_MODE, {begin: hljs.UNDERSCORE_IDENT_RE + '(=(?!>))?'})
+      ]
+    }
+  ];
   return {
+    aliases: ['ls', 'lassoscript'],
     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'
-    },
+    lexemes: LASSO_IDENT_RE + '|&[lg]t;',
+    keywords: LASSO_KEYWORDS,
     contains: [
       {
         className: 'preprocessor',
-        begin: '\\]|\\?>',
+        begin: LASSO_CLOSE_RE,
         relevance: 0,
         starts: {
           className: 'markup',
-          end: '\\[|' + LASSO_START,
-          returnEnd: true
+          end: '\\[|' + LASSO_ANGLE_RE,
+          returnEnd: true,
+          relevance: 0,
+          contains: [ HTML_COMMENT ]
         }
       },
+      LASSO_NOPROCESS,
+      LASSO_START,
       {
         className: 'preprocessor',
-        begin: '\\[noprocess\\]',
+        begin: '\\[no_square_brackets',
         starts: {
-          className: 'markup',
-          end: '\\[/noprocess\\]',
-          returnEnd: true
+          end: '\\[/no_square_brackets\\]', // not implemented in the language
+          lexemes: LASSO_IDENT_RE + '|&[lg]t;',
+          keywords: LASSO_KEYWORDS,
+          contains: [
+            {
+              className: 'preprocessor',
+              begin: LASSO_CLOSE_RE,
+              relevance: 0,
+              starts: {
+                className: 'markup',
+                end: LASSO_ANGLE_RE,
+                returnEnd: true,
+                contains: [ HTML_COMMENT ]
+              }
+            },
+            LASSO_NOPROCESS,
+            LASSO_START
+          ].concat(LASSO_CODE)
         }
       },
       {
         className: 'preprocessor',
-        begin: '\\[no_square_brackets|\\[/noprocess|' + LASSO_START
-      },
-      {
-        className: 'preprocessor',
         begin: '\\[',
         relevance: 0
       },
@@ -70,43 +175,7 @@ function(hljs) {
         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 + '=?'
-          }
-        ]
       }
-    ]
+    ].concat(LASSO_CODE)
   };
 }
diff --git a/src/languages/lisp.js b/src/languages/lisp.js
index 8cfdbeb..0105688 100644
--- a/src/languages/lisp.js
+++ b/src/languages/lisp.js
@@ -15,29 +15,17 @@ function(hljs) {
     className: 'literal',
     begin: '\\b(t{1}|nil)\\b'
   };
-  var NUMBERS = [
-    {
-      className: 'number', begin: LISP_SIMPLE_NUMBER_RE
-    },
-    {
-      className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
-    },
-    {
-      className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
-    },
-    {
-      className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
-    },
-    {
-      className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
-    }
-  ]
-  var STRING = {
-    className: 'string',
-    begin: '"', end: '"',
-    contains: [hljs.BACKSLASH_ESCAPE],
-    relevance: 0
+  var NUMBER = {
+    className: 'number',
+    variants: [
+      {begin: LISP_SIMPLE_NUMBER_RE, relevance: 0},
+      {begin: '#b[0-1]+(/[0-1]+)?'},
+      {begin: '#o[0-7]+(/[0-7]+)?'},
+      {begin: '#x[0-9a-f]+(/[0-9a-f]+)?'},
+      {begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'}
+    ]
   };
+  var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null});
   var COMMENT = {
     className: 'comment',
     begin: ';', end: '$'
@@ -52,18 +40,20 @@ function(hljs) {
   };
   var QUOTED_LIST = {
     begin: '\\(', end: '\\)',
-    contains: ['self', LITERAL, STRING].concat(NUMBERS)
-  };
-  var QUOTED1 = {
-    className: 'quoted',
-    begin: '[\'`]\\(', end: '\\)',
-    contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
+    contains: ['self', LITERAL, STRING, NUMBER]
   };
-  var QUOTED2 = {
+  var QUOTED = {
     className: 'quoted',
-    begin: '\\(quote ', end: '\\)',
-    keywords: {title: 'quote'},
-    contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
+    contains: [NUMBER, STRING, VARIABLE, KEYWORD, QUOTED_LIST],
+    variants: [
+      {
+        begin: '[\'`]\\(', end: '\\)',
+      },
+      {
+        begin: '\\(quote ', end: '\\)',
+        keywords: {title: 'quote'},
+      }
+    ]
   };
   var LIST = {
     className: 'list',
@@ -74,17 +64,18 @@ function(hljs) {
     relevance: 0
   };
   LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
-  BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
+  BODY.contains = [QUOTED, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD];
 
   return {
-    illegal: '[^\\s]',
-    contains: NUMBERS.concat([
+    illegal: /\S/,
+    contains: [
+      NUMBER,
       SHEBANG,
       LITERAL,
       STRING,
       COMMENT,
-      QUOTED1, QUOTED2,
+      QUOTED,
       LIST
-    ])
+    ]
   };
 }
diff --git a/src/languages/livecodeserver.js b/src/languages/livecodeserver.js
new file mode 100644
index 0000000..19883d6
--- /dev/null
+++ b/src/languages/livecodeserver.js
@@ -0,0 +1,176 @@
+/*
+Language: LiveCode server and revIgniter
+Author: Ralf Bitter <rabit at revigniter.com>
+Description: Language definition for LiveCode server accounting for revIgniter (a web application framework) characteristics.
+Version: 1.0a
+Date: 2013-06-03
+*/
+
+function(hljs) {
+  var VARIABLE = {
+    className: 'variable', begin: '\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+',
+    relevance: 0
+  };
+  var COMMENT = {
+    className: 'comment', end: '$',
+    variants: [
+      hljs.C_BLOCK_COMMENT_MODE,
+      hljs.HASH_COMMENT_MODE,
+      {
+        begin: '--',
+      },
+      {
+        begin: '[^:]//',
+      }
+    ]
+  };
+  var TITLE1 = hljs.inherit(hljs.TITLE_MODE, {
+    variants: [
+      {begin: '\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*'},
+      {begin: '\\b_[a-z0-9\\-]+'}
+    ]
+  });
+  var TITLE2 = hljs.inherit(hljs.TITLE_MODE, {begin: '\\b([A-Za-z0-9_\\-]+)\\b'});
+  return {
+    case_insensitive: false,
+    keywords: {
+      keyword:
+        'after byte bytes english the until http forever descending using line real8 with seventh ' +
+        'for stdout finally element word fourth before black ninth sixth characters chars stderr ' +
+        'uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid ' +
+        'at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 ' +
+        'int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat ' +
+        'end repeat URL in try into switch to words https token binfile each tenth as ticks tick ' +
+        'system real4 by dateItems without char character ascending eighth whole dateTime numeric short ' +
+        'first ftp integer abbreviated abbr abbrev private case while if',
+      constant:
+        'SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE ' +
+        'QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO ' +
+        'six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five ' +
+        'quote empty one true return cr linefeed right backslash null seven tab three two ' +
+        'RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK ' +
+        'FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK',
+      operator:
+        'div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within ' +
+        'contains ends with begins the keys of keys',
+      built_in:
+        'put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg base64Decode ' +
+        'base64Encode baseConvert binaryDecode binaryEncode byteToNum cachedURL cachedURLs charToNum ' +
+        'cipherNames commandNames compound compress constantNames cos date dateFormat decompress directories ' +
+        'diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames global ' +
+        'globals hasMemory hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset ' +
+        'keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders ' +
+        'libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 ' +
+        'longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec ' +
+        'millisecs millisecond milliseconds min monthNames num number numToByte numToChar offset open openfiles ' +
+        'openProcesses openProcessIDs openSockets paramCount param params peerAddress pendingMessages platform ' +
+        'processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord ' +
+        'revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull ' +
+        'revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered ' +
+        'revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames ' +
+        'revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull ' +
+        'revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections ' +
+        'revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype ' +
+        'revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext ' +
+        'revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames ' +
+        'revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase ' +
+        'revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath ' +
+        'revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames ' +
+        'revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren ' +
+        'revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents ' +
+        'revXMLRPC_Error revXMLRPC_Execute revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText ' +
+        'revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort ' +
+        'revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree ' +
+        'revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round ' +
+        'sec secs seconds sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound ' +
+        'stdDev sum sysError systemVersion tan tempName tick ticks time to toLower toUpper transpose trunc ' +
+        'uniDecode uniEncode upper URLDecode URLEncode URLStatus value variableNames version waitDepth weekdayNames wordOffset ' +
+        'add breakpoint cancel clear local variable file word line folder directory URL close socket process ' +
+        'combine constant convert create new alias folder directory decrypt delete variable word line folder ' +
+        'directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile ' +
+        'libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback ' +
+        'libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime ' +
+        'libURLSetStatusCallback load multiply socket process post seek rel relative read from process rename ' +
+        'replace require resetAll revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase ' +
+        'revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees ' +
+        'revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord ' +
+        'revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase ' +
+        'revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD ' +
+        'revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost ' +
+        'revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData ' +
+        'revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel ' +
+        'revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback ' +
+        'revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split ' +
+        'subtract union unload wait write'
+    },
+    contains: [
+      VARIABLE,
+      {
+        className: 'keyword',
+        begin: '\\bend\\sif\\b'
+      },
+      {
+        className: 'function',
+        beginKeywords: 'function', end: '$',
+        contains: [
+          VARIABLE,
+          TITLE2,
+          hljs.APOS_STRING_MODE,
+          hljs.QUOTE_STRING_MODE,
+          hljs.BINARY_NUMBER_MODE,
+          hljs.C_NUMBER_MODE,
+          TITLE1
+        ]
+      },
+      {
+        className: 'function',
+        beginKeywords: 'end', end: '$',
+        contains: [
+          TITLE2,
+          TITLE1
+        ]
+      },
+      {
+        className: 'command',
+        beginKeywords: 'command on', end: '$',
+        contains: [
+          VARIABLE,
+          TITLE2,
+          hljs.APOS_STRING_MODE,
+          hljs.QUOTE_STRING_MODE,
+          hljs.BINARY_NUMBER_MODE,
+          hljs.C_NUMBER_MODE,
+          TITLE1
+        ]
+      },
+      {
+        className: 'command',
+        beginKeywords: 'end', end: '$',
+        contains: [
+          TITLE2,
+          TITLE1
+        ]
+      },
+      {
+        className: 'preprocessor',
+        begin: '<\\?rev|<\\?lc|<\\?livecode',
+        relevance: 10
+      },
+      {
+        className: 'preprocessor',
+        begin: '<\\?'
+      },
+      {
+        className: 'preprocessor',
+        begin: '\\?>'
+      },
+      COMMENT,
+      hljs.APOS_STRING_MODE,
+      hljs.QUOTE_STRING_MODE,
+      hljs.BINARY_NUMBER_MODE,
+      hljs.C_NUMBER_MODE,
+      TITLE1
+    ],
+    illegal: ';$|^\\[|^='
+  };
+}
diff --git a/src/languages/lua.js b/src/languages/lua.js
index 5439e2f..eea26ff 100644
--- a/src/languages/lua.js
+++ b/src/languages/lua.js
@@ -23,7 +23,7 @@ function(hljs) {
     }
   ]
   return {
-    lexems: hljs.UNDERSCORE_IDENT_RE,
+    lexemes: hljs.UNDERSCORE_IDENT_RE,
     keywords: {
       keyword:
         'and break do else elseif end false for if in local nil not or repeat return then ' +
@@ -37,13 +37,9 @@ function(hljs) {
     contains: COMMENTS.concat([
       {
         className: 'function',
-        beginWithKeyword: true, end: '\\)',
-        keywords: 'function',
+        beginKeywords: 'function', end: '\\)',
         contains: [
-          {
-            className: 'title',
-            begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'
-          },
+          hljs.inherit(hljs.TITLE_MODE, {begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'}),
           {
             className: 'params',
             begin: '\\(', endsWithParent: true,
diff --git a/src/languages/makefile.js b/src/languages/makefile.js
new file mode 100644
index 0000000..f796b70
--- /dev/null
+++ b/src/languages/makefile.js
@@ -0,0 +1,48 @@
+/*
+Language: Makefile
+Author: Ivan Sagalaev <maniac at softwaremaniacs.org>
+*/
+
+function(hljs) {
+  var VARIABLE = {
+    className: 'variable',
+    begin: /\$\(/, end: /\)/,
+    contains: [hljs.BACKSLASH_ESCAPE]
+  }
+  return {
+    contains: [
+      hljs.HASH_COMMENT_MODE,
+      {
+        begin: /^\w+\s*\W*=/, returnBegin: true,
+        relevance: 0,
+        starts: {
+          className: 'constant',
+          end: /\s*\W*=/, excludeEnd: true,
+          starts: {
+            end: /$/,
+            relevance: 0,
+            contains: [
+              VARIABLE
+            ],
+          }
+        }
+      },
+      {
+        className: 'title',
+        begin: /^[\w]+:\s*$/
+      },
+      {
+        className: 'phony',
+        begin: /^\.PHONY:/, end: /$/,
+        keywords: '.PHONY', lexemes: /[\.\w]+/
+      },
+      {
+        begin: /^\t+/, end: /$/,
+        contains: [
+          hljs.QUOTE_STRING_MODE,
+          VARIABLE
+        ]
+      }
+    ]
+  };
+}
diff --git a/src/languages/markdown.js b/src/languages/markdown.js
index 707dce7..e13b089 100644
--- a/src/languages/markdown.js
+++ b/src/languages/markdown.js
@@ -11,11 +11,10 @@ function(hljs) {
       // highlight headers
       {
         className: 'header',
-        begin: '^#{1,3}', end: '$'
-      },
-      {
-        className: 'header',
-        begin: '^.+?\\n[=-]{2,}$'
+        variants: [
+          { begin: '^#{1,6}', end: '$' },
+          { begin: '^.+?\\n[=-]{2,}$' }
+        ]
       },
       // inline html
       {
@@ -36,12 +35,12 @@ function(hljs) {
       // emphasis segments
       {
         className: 'emphasis',
-        begin: '\\*.+?\\*'
-      },
-      {
-        className: 'emphasis',
-        begin: '_.+?_',
-        relevance: 0
+        variants: [
+          { begin: '\\*.+?\\*' },
+          { begin: '_.+?_'
+          , relevance: 0
+          }
+        ]
       },
       // blockquotes
       {
@@ -51,31 +50,55 @@ function(hljs) {
       // code snippets
       {
         className: 'code',
-        begin: '`.+?`'
-      },
-      {
-        className: 'code',
-        begin: '^    ', end: '$',
-        relevance: 0
+        variants: [
+          { begin: '`.+?`' },
+          { begin: '^( {4}|\t)', end: '$'
+          , relevance: 0
+          }
+        ]
       },
       // horizontal rules
       {
         className: 'horizontal_rule',
-        begin: '^-{3,}', end: '$'
+        begin: '^[-\\*]{3,}', end: '$'
       },
       // using links - title and link
       {
-        begin: '\\[.+?\\]\\(.+?\\)',
+        begin: '\\[.+?\\][\\(\\[].+?[\\)\\]]',
         returnBegin: true,
         contains: [
           {
             className: 'link_label',
-            begin: '\\[.+\\]'
+            begin: '\\[', end: '\\]',
+            excludeBegin: true,
+            returnEnd: true,
+            relevance: 0
           },
           {
             className: 'link_url',
-            begin: '\\(', end: '\\)',
+            begin: '\\]\\(', end: '\\)',
+            excludeBegin: true, excludeEnd: true
+          },
+          {
+            className: 'link_reference',
+            begin: '\\]\\[', end: '\\]',
+            excludeBegin: true, excludeEnd: true,
+          }
+        ],
+        relevance: 10
+      },
+      {
+        begin: '^\\[\.+\\]:', end: '$',
+        returnBegin: true,
+        contains: [
+          {
+            className: 'link_reference',
+            begin: '\\[', end: '\\]',
             excludeBegin: true, excludeEnd: true
+          },
+          {
+            className: 'link_url',
+            begin: '\\s', end: '$'
           }
         ]
       }
diff --git a/src/languages/mathematica.js b/src/languages/mathematica.js
new file mode 100644
index 0000000..229097f
--- /dev/null
+++ b/src/languages/mathematica.js
@@ -0,0 +1,63 @@
+/*
+Language: Mathematica
+Author: Daniel Kvasnicka <dkvasnicka at vendavo.com>
+*/
+
+function(hljs) {
+  return {
+    aliases: ['mma'],
+    lexemes: '(\\$|\\b)' + hljs.IDENT_RE + '\\b',
+    keywords: 'AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox Ad [...]
+      'BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY B [...]
+      'C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression Cel [...]
+      'ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint C [...]
+      'D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decr [...]
+      'DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTes [...]
+      'E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality E [...]
+      'FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileEx [...]
+      'FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImp [...]
+      'GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecompos [...]
+      'GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions G [...]
+      'HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomp [...]
+      'I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack Imag [...]
+      'InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDis [...]
+      'JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition ' +
+      'K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest [...]
+      'Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRig [...]
+      'LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLe [...]
+      'MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ  [...]
+      'N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle  [...]
+      'NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot ' +
+      'O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistr [...]
+      'PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent Paragra [...]
+      'PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction Print [...]
+      'QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder ' +
+      'RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterB [...]
+      'SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposit [...]
+      'SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTe [...]
+      'SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistributi [...]
+      'Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand Tens [...]
+      'Transparent ' +
+      'UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep Unit [...]
+      'V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version Version [...]
+      'WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDi [...]
+      'XMLElement XMLObject Xnor Xor ' +
+      'Yellow YuleDissimilarity ' +
+      'ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform ' +
+      '$Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFu [...]
+    contains: [
+      {
+        className: "comment",
+        begin: /\(\*/, end: /\*\)/
+      },
+      hljs.APOS_STRING_MODE,
+      hljs.QUOTE_STRING_MODE,
+      hljs.C_NUMBER_MODE,
+      {
+        className: 'list',
+        begin: /\{/, end: /\}/,
+        illegal: /:/
+      }
+    ]
+  };
+}
diff --git a/src/languages/matlab.js b/src/languages/matlab.js
index 99190fb..18081d2 100644
--- a/src/languages/matlab.js
+++ b/src/languages/matlab.js
@@ -11,8 +11,7 @@ function(hljs) {
     {
       className: 'string',
       begin: '\'', end: '\'',
-      contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
-      relevance: 0
+      contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
     }
   ];
 
@@ -41,13 +40,9 @@ function(hljs) {
     contains: [
       {
         className: 'function',
-        beginWithKeyword: true, end: '$',
-        keywords: 'function',
+        beginKeywords: 'function', end: '$',
         contains: [
-          {
-              className: 'title',
-              begin: hljs.UNDERSCORE_IDENT_RE
-          },
+          hljs.UNDERSCORE_TITLE_MODE,
           {
               className: 'params',
               begin: '\\(', end: '\\)'
@@ -60,17 +55,20 @@ function(hljs) {
       },
       {
         className: 'transposed_variable',
-        begin: '[a-zA-Z_][a-zA-Z_0-9]*(\'+[\\.\']*|[\\.\']+)', end: ''
+        begin: '[a-zA-Z_][a-zA-Z_0-9]*(\'+[\\.\']*|[\\.\']+)', end: '',
+        relevance: 0
       },
       {
         className: 'matrix',
         begin: '\\[', end: '\\]\'*[\\.\']*',
-        contains: COMMON_CONTAINS
+        contains: COMMON_CONTAINS,
+        relevance: 0
       },
       {
         className: 'cell',
         begin: '\\{', end: '\\}\'*[\\.\']*',
-        contains: COMMON_CONTAINS
+        contains: COMMON_CONTAINS,
+        illegal: /:/
       },
       {
         className: 'comment',
diff --git a/src/languages/mel.js b/src/languages/mel.js
index c05320e..b8f2cf0 100644
--- a/src/languages/mel.js
+++ b/src/languages/mel.js
@@ -44,7 +44,7 @@ function(hljs) {
       'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' +
       'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' +
       'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' +
-      'currentCtx currentTime currentTimeCtx currentUnit currentUnit curve curveAddPtCtx ' +
+      'currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx ' +
       'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' +
       'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' +
       'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' +
@@ -61,7 +61,7 @@ function(hljs) {
       'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' +
       'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' +
       'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' +
-      'equivalent equivalentTol erf error eval eval evalDeferred evalEcho event ' +
+      'equivalent equivalentTol erf error eval evalDeferred evalEcho event ' +
       'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' +
       'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' +
       'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' +
@@ -222,12 +222,11 @@ function(hljs) {
       },
       {
         className: 'variable',
-        begin: '\\$\\d',
-        relevance: 5
-      },
-      {
-        className: 'variable',
-        begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)'
+        variants: [
+          {begin: '\\$\\d'},
+          {begin: '[\\$\\%\\@](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)'},
+          {begin: '\\*(\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)', relevance: 0}
+        ]
       },
       hljs.C_LINE_COMMENT_MODE,
       hljs.C_BLOCK_COMMENT_MODE
diff --git a/src/languages/nginx.js b/src/languages/nginx.js
index e1796d6..97c9c4e 100644
--- a/src/languages/nginx.js
+++ b/src/languages/nginx.js
@@ -5,20 +5,17 @@ Contributors: Ivan Sagalaev <maniac at softwaremaniacs.org>
 */
 
 function(hljs) {
-  var VARS = [
-    {
-      className: 'variable', begin: '\\$\\d+'
-    },
-    {
-      className: 'variable', begin: '\\${', end: '}'
-    },
-    {
-      className: 'variable', begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE
-    }
-  ];
+  var VAR = {
+    className: 'variable',
+    variants: [
+      {begin: /\$\d+/},
+      {begin: /\$\{/, end: /}/},
+      {begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE}
+    ]
+  };
   var DEFAULT = {
     endsWithParent: true,
-    lexems: '[a-z/_]+',
+    lexemes: '[a-z/_]+',
     keywords: {
       built_in:
         'on off yes no true false none blocked debug info notice warn error crit ' +
@@ -30,15 +27,11 @@ function(hljs) {
       hljs.HASH_COMMENT_MODE,
       {
         className: 'string',
-        begin: '"', end: '"',
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
-        relevance: 0
-      },
-      {
-        className: 'string',
-        begin: "'", end: "'",
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
-        relevance: 0
+        contains: [hljs.BACKSLASH_ESCAPE, VAR],
+        variants: [
+          {begin: /"/, end: /"/},
+          {begin: /'/, end: /'/}
+        ]
       },
       {
         className: 'url',
@@ -46,26 +39,16 @@ function(hljs) {
       },
       {
         className: 'regexp',
-        begin: "\\s\\^", end: "\\s|{|;", returnEnd: true,
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
-      },
-      // regexp locations (~, ~*)
-      {
-        className: 'regexp',
-        begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true,
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
-      },
-      // *.example.com
-      {
-        className: 'regexp',
-        begin: "\\*(\\.[a-z\\-]+)+",
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
-      },
-      // sub.example.*
-      {
-        className: 'regexp',
-        begin: "([a-z\\-]+\\.)+\\*",
-        contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
+        contains: [hljs.BACKSLASH_ESCAPE, VAR],
+        variants: [
+          {begin: "\\s\\^", end: "\\s|{|;", returnEnd: true},
+          // regexp locations (~, ~*)
+          {begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true},
+          // *.example.com
+          {begin: "\\*(\\.[a-z\\-]+)+"},
+          // sub.example.*
+          {begin: "([a-z\\-]+\\.)+\\*"}
+        ]
       },
       // IP
       {
@@ -77,8 +60,9 @@ function(hljs) {
         className: 'number',
         begin: '\\b\\d+[kKmMgGdshdwy]*\\b',
         relevance: 0
-      }
-    ].concat(VARS)
+      },
+      VAR
+    ]
   };
 
   return {
@@ -87,11 +71,7 @@ function(hljs) {
       {
         begin: hljs.UNDERSCORE_IDENT_RE + '\\s', end: ';|{', returnBegin: true,
         contains: [
-          {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE,
-            starts: DEFAULT
-          }
+          hljs.inherit(hljs.UNDERSCORE_TITLE_MODE, {starts: DEFAULT})
         ],
         relevance: 0
       }
diff --git a/src/languages/objectivec.js b/src/languages/objectivec.js
index 2733cd1..79ed765 100644
--- a/src/languages/objectivec.js
+++ b/src/languages/objectivec.js
@@ -7,13 +7,14 @@ Contributors: Angel G. Olloqui <angelgarcia.mail at gmail.com>
 function(hljs) {
   var OBJC_KEYWORDS = {
     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 asm case short default double throw register explicit ' +
-      'signed typename try this switch continue wchar_t inline readonly assign property ' +
-      'self synchronized end synthesize id optional required ' +
-      'nonatomic super unichar finally dynamic IBOutlet IBAction selector strong ' +
-      'weak readonly',
+      'int float while char export sizeof typedef const struct for union ' +
+      'unsigned long volatile static bool mutable if do return goto void ' +
+      'enum else break extern asm case short default double register explicit ' +
+      'signed typename this switch continue wchar_t inline readonly assign ' +
+      'self synchronized id ' +
+      'nonatomic super unichar IBOutlet IBAction strong weak ' +
+      '@private @protected @public @try @property @end @throw @catch @finally ' +
+      '@synthesize @dynamic @selector @optional @required',
     literal:
     	'false true FALSE TRUE nil YES NO NULL',
     built_in:
@@ -31,8 +32,10 @@ function(hljs) {
       'UIInterfaceOrientation MPMoviePlayerController dispatch_once_t ' +
       'dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
   };
+  var LEXEMES = /[a-zA-Z@][a-zA-Z0-9_]*/;
+  var CLASS_KEYWORDS = '@interface @class @protocol @implementation';
   return {
-    keywords: OBJC_KEYWORDS,
+    keywords: OBJC_KEYWORDS, lexemes: LEXEMES,
     illegal: '</',
     contains: [
       hljs.C_LINE_COMMENT_MODE,
@@ -70,13 +73,10 @@ function(hljs) {
       },
       {
         className: 'class',
-        beginWithKeyword: true,
-        end: '({|$)',
-        keywords: 'interface class protocol implementation',
-        contains: [{
-          className: 'id',
-          begin: hljs.UNDERSCORE_IDENT_RE
-        }
+        begin: '(' + CLASS_KEYWORDS.split(' ').join('|') + ')\\b', end: '({|$)',
+        keywords: CLASS_KEYWORDS, lexemes: LEXEMES,
+        contains: [
+          hljs.UNDERSCORE_TITLE_MODE
         ]
       },
       {
diff --git a/src/languages/ocaml.js b/src/languages/ocaml.js
new file mode 100644
index 0000000..bfcd768
--- /dev/null
+++ b/src/languages/ocaml.js
@@ -0,0 +1,48 @@
+/*
+Language: OCaml
+Author: Mehdi Dogguy <mehdi at dogguy.org>
+Contributors: Nicolas Braud-Santoni <nicolas.braud-santoni at ens-cachan.fr>
+Description: OCaml language definition.
+*/
+function(hljs) {
+  return {
+    keywords: {
+      keyword:
+        'and as assert asr begin class constraint do done downto else end ' +
+        'exception external false for fun function functor if in include ' +
+        'inherit initializer land lazy let lor lsl lsr lxor match method ' +
+        'mod module mutable new object of open or private rec ref sig struct ' +
+        'then to true try type val virtual when while with parser value',
+      built_in:
+        'bool char float int list unit array exn option int32 int64 nativeint ' +
+        'format4 format6 lazy_t in_channel out_channel string',
+    },
+    illegal: /\/\//,
+    contains: [
+      {
+        className: 'string',
+        begin: '"""', end: '"""'
+      },
+      {
+        className: 'comment',
+        begin: '\\(\\*', end: '\\*\\)',
+        contains: ['self']
+      },
+      {
+        className: 'class',
+        beginKeywords: 'type', end: '\\(|=|$',
+        contains: [
+          hljs.UNDERSCORE_TITLE_MODE
+        ]
+      },
+      {
+        className: 'annotation',
+        begin: '\\[<', end: '>\\]'
+      },
+      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/oxygene.js b/src/languages/oxygene.js
new file mode 100644
index 0000000..7290d8c
--- /dev/null
+++ b/src/languages/oxygene.js
@@ -0,0 +1,70 @@
+/*
+Language: Oxygene
+Author: Carlo Kok <ck at remobjects.com>
+Description: Language definition for RemObjects Oxygene (http://www.remobjects.com)
+*/
+
+function(hljs) {
+  var OXYGENE_KEYWORDS = 'abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue '+
+    'create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false '+
+	'final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited'+
+	' inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of '+
+	'old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly '+
+	'record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple '+
+	'type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal '+
+	'register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained';
+  var CURLY_COMMENT =  {
+    className: 'comment',
+    begin: '{', end: '}',
+    relevance: 0
+  };
+  var PAREN_COMMENT = {
+    className: 'comment',
+    begin: '\\(\\*', end: '\\*\\)',
+    relevance: 10
+  };
+  var STRING = {
+    className: 'string',
+    begin: '\'', end: '\'',
+    contains: [{begin: '\'\''}]
+  };
+  var CHAR_STRING = {
+    className: 'string', begin: '(#\\d+)+'
+  };
+  var FUNCTION = {
+    className: 'function',
+    beginKeywords: 'function constructor destructor procedure method', end: '[:;]',
+    keywords: 'function constructor|10 destructor|10 procedure|10 method|10',
+    contains: [
+      hljs.TITLE_MODE,
+      {
+        className: 'params',
+        begin: '\\(', end: '\\)',
+        keywords: OXYGENE_KEYWORDS,
+        contains: [STRING, CHAR_STRING]
+      },
+      CURLY_COMMENT, PAREN_COMMENT
+    ]
+  };
+  return {
+    case_insensitive: true,
+    keywords: OXYGENE_KEYWORDS,
+    illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
+    contains: [
+      CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
+      STRING, CHAR_STRING,
+      hljs.NUMBER_MODE,
+      FUNCTION,
+      {
+        className: 'class',
+        begin: '=\\bclass\\b', end: 'end;',
+        keywords: OXYGENE_KEYWORDS,
+        contains: [
+          STRING, CHAR_STRING,
+          CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
+          FUNCTION
+        ]
+      }
+    ]
+  };
+}
diff --git a/src/languages/perl.js b/src/languages/perl.js
index 2a43b71..3b26c93 100644
--- a/src/languages/perl.js
+++ b/src/languages/perl.js
@@ -26,23 +26,18 @@ function(hljs) {
   var SUBST = {
     className: 'subst',
     begin: '[$@]\\{', end: '\\}',
-    keywords: PERL_KEYWORDS,
-    relevance: 10
+    keywords: PERL_KEYWORDS
   };
-  var VAR1 = {
-    className: 'variable',
-    begin: '\\$\\d'
+  var METHOD = {
+    begin: '->{', end: '}'
+    // contains defined later
   };
-  var VAR2 = {
+  var VAR = {
     className: 'variable',
-    begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)'
-  };
-  var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR1, VAR2];
-  var METHOD = {
-    begin: '->',
-    contains: [
-      {begin: hljs.IDENT_RE},
-      {begin: '{', end: '}'}
+    variants: [
+      {begin: /\$\d/},
+      {begin: /[\$\%\@\*](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},
+      {begin: /[\$\%\@\*][^\s\w{]/, relevance: 0}
     ]
   };
   var COMMENT = {
@@ -50,8 +45,9 @@ function(hljs) {
     begin: '^(__END__|__DATA__)', end: '\\n$',
     relevance: 5
   }
+  var STRING_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST, VAR];
   var PERL_DEFAULT_CONTAINS = [
-    VAR1, VAR2,
+    VAR,
     hljs.HASH_COMMENT_MODE,
     COMMENT,
     {
@@ -61,66 +57,54 @@ function(hljs) {
     METHOD,
     {
       className: 'string',
-      begin: 'q[qwxr]?\\s*\\(', end: '\\)',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: 'q[qwxr]?\\s*\\[', end: '\\]',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: 'q[qwxr]?\\s*\\{', end: '\\}',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: 'q[qwxr]?\\s*\\|', end: '\\|',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: 'q[qwxr]?\\s*\\<', end: '\\>',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: 'qw\\s+q', end: 'q',
-      contains: STRING_CONTAINS,
-      relevance: 5
-    },
-    {
-      className: 'string',
-      begin: '\'', end: '\'',
-      contains: [hljs.BACKSLASH_ESCAPE],
-      relevance: 0
-    },
-    {
-      className: 'string',
-      begin: '"', end: '"',
       contains: STRING_CONTAINS,
-      relevance: 0
-    },
-    {
-      className: 'string',
-      begin: '`', end: '`',
-      contains: [hljs.BACKSLASH_ESCAPE]
-    },
-    {
-      className: 'string',
-      begin: '{\\w+}',
-      relevance: 0
-    },
-    {
-      className: 'string',
-      begin: '\-?\\w+\\s*\\=\\>',
-      relevance: 0
+      variants: [
+        {
+          begin: 'q[qwxr]?\\s*\\(', end: '\\)',
+          relevance: 5
+        },
+        {
+          begin: 'q[qwxr]?\\s*\\[', end: '\\]',
+          relevance: 5
+        },
+        {
+          begin: 'q[qwxr]?\\s*\\{', end: '\\}',
+          relevance: 5
+        },
+        {
+          begin: 'q[qwxr]?\\s*\\|', end: '\\|',
+          relevance: 5
+        },
+        {
+          begin: 'q[qwxr]?\\s*\\<', end: '\\>',
+          relevance: 5
+        },
+        {
+          begin: 'qw\\s+q', end: 'q',
+          relevance: 5
+        },
+        {
+          begin: '\'', end: '\'',
+          contains: [hljs.BACKSLASH_ESCAPE]
+        },
+        {
+          begin: '"', end: '"'
+        },
+        {
+          begin: '`', end: '`',
+          contains: [hljs.BACKSLASH_ESCAPE]
+        },
+        {
+          begin: '{\\w+}',
+          contains: [],
+          relevance: 0
+        },
+        {
+          begin: '\-?\\w+\\s*\\=\\>',
+          contains: [],
+          relevance: 0
+        }
+      ]
     },
     {
       className: 'number',
@@ -128,7 +112,7 @@ function(hljs) {
       relevance: 0
     },
     { // regexp container
-      begin: '(' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
+      begin: '(\\/\\/|' + hljs.RE_STARTERS_RE + '|\\b(split|return|print|reverse|grep)\\b)\\s*',
       keywords: 'split return print reverse grep',
       relevance: 0,
       contains: [
@@ -149,8 +133,7 @@ function(hljs) {
     },
     {
       className: 'sub',
-      beginWithKeyword: true, end: '(\\s*\\(.*?\\))?[;{]',
-      keywords: 'sub',
+      beginKeywords: 'sub', end: '(\\s*\\(.*?\\))?[;{]',
       relevance: 5
     },
     {
@@ -160,7 +143,7 @@ function(hljs) {
     }
   ];
   SUBST.contains = PERL_DEFAULT_CONTAINS;
-  METHOD.contains[1].contains = PERL_DEFAULT_CONTAINS;
+  METHOD.contains = PERL_DEFAULT_CONTAINS;
 
   return {
     keywords: PERL_KEYWORDS,
diff --git a/src/languages/php.js b/src/languages/php.js
index 6a31dd4..72f0aa8 100644
--- a/src/languages/php.js
+++ b/src/languages/php.js
@@ -8,100 +8,106 @@ function(hljs) {
   var VARIABLE = {
     className: 'variable', begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
   };
-  var STRINGS = [
-    hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
-    hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
-    {
-      className: 'string',
-      begin: 'b"', end: '"',
-      contains: [hljs.BACKSLASH_ESCAPE]
-    },
-    {
-      className: 'string',
-      begin: 'b\'', end: '\'',
-      contains: [hljs.BACKSLASH_ESCAPE]
-    }
-  ];
-  var NUMBERS = [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE];
-  var TITLE = {
-    className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
+  var PREPROCESSOR = {
+    className: 'preprocessor', begin: /<\?(php)?|\?>/
   };
+  var STRING = {
+    className: 'string',
+    contains: [hljs.BACKSLASH_ESCAPE, PREPROCESSOR],
+    variants: [
+      {
+        begin: 'b"', end: '"'
+      },
+      {
+        begin: 'b\'', end: '\''
+      },
+      hljs.inherit(hljs.APOS_STRING_MODE, {illegal: null}),
+      hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null})
+    ]
+  };
+  var NUMBER = {variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]};
   return {
     case_insensitive: true,
     keywords:
       'and include_once list abstract global private echo interface as static endswitch ' +
       'array null if endwhile or const for endforeach self var while isset public ' +
       'protected exit foreach throw elseif include __FILE__ empty require_once do xor ' +
-      'return implements parent clone use __CLASS__ __LINE__ else break print eval new ' +
-      'catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ ' +
-      'enddeclare final try this switch continue endfor endif declare unset true false ' +
-      'namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler',
+      'return parent clone use __CLASS__ __LINE__ else break print eval new ' +
+      'catch __METHOD__ case exception default die require __FUNCTION__ ' +
+      'enddeclare final try switch continue endfor endif declare unset true false ' +
+      'trait goto instanceof insteadof __DIR__ __NAMESPACE__ ' +
+      'yield finally',
     contains: [
       hljs.C_LINE_COMMENT_MODE,
       hljs.HASH_COMMENT_MODE,
       {
         className: 'comment',
         begin: '/\\*', end: '\\*/',
-        contains: [{
+        contains: [
+          {
             className: 'phpdoc',
             begin: '\\s@[A-Za-z]+'
-        }]
+          },
+          PREPROCESSOR
+        ]
       },
       {
           className: 'comment',
-          excludeBegin: true,
-          begin: '__halt_compiler.+?;', endsWithParent: true
+          begin: '__halt_compiler.+?;', endsWithParent: true,
+          keywords: '__halt_compiler', lexemes: hljs.UNDERSCORE_IDENT_RE
       },
       {
         className: 'string',
         begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',
         contains: [hljs.BACKSLASH_ESCAPE]
       },
-      {
-        className: 'preprocessor',
-        begin: '<\\?php',
-        relevance: 10
-      },
-      {
-        className: 'preprocessor',
-        begin: '\\?>'
-      },
+      PREPROCESSOR,
       VARIABLE,
       {
         className: 'function',
-        beginWithKeyword: true, end: '{',
-        keywords: 'function',
+        beginKeywords: 'function', end: /[;{]/,
         illegal: '\\$|\\[|%',
         contains: [
-          TITLE,
+          hljs.UNDERSCORE_TITLE_MODE,
           {
             className: 'params',
             begin: '\\(', end: '\\)',
             contains: [
               'self',
               VARIABLE,
-              hljs.C_BLOCK_COMMENT_MODE
-            ].concat(STRINGS).concat(NUMBERS)
+              hljs.C_BLOCK_COMMENT_MODE,
+              STRING,
+              NUMBER
+            ]
           }
         ]
       },
       {
         className: 'class',
-        beginWithKeyword: true, end: '{',
-        keywords: 'class',
-        illegal: '[:\\(\\$]',
+        beginKeywords: 'class interface', end: '{',
+        illegal: /[:\(\$"]/,
         contains: [
           {
-            beginWithKeyword: true, endsWithParent: true,
-            keywords: 'extends',
-            contains: [TITLE]
+            beginKeywords: 'extends implements',
+            relevance: 10
           },
-          TITLE
+          hljs.UNDERSCORE_TITLE_MODE
         ]
       },
       {
+        beginKeywords: 'namespace', end: ';',
+        illegal: /[\.']/,
+        contains: [hljs.UNDERSCORE_TITLE_MODE]
+      },
+      {
+        beginKeywords: 'use', end: ';',
+        contains: [hljs.UNDERSCORE_TITLE_MODE]
+      },
+      {
         begin: '=>' // No markup, just a relevance booster
-      }
-    ].concat(STRINGS).concat(NUMBERS)
+      },
+      STRING,
+      NUMBER
+    ]
   };
 }
diff --git a/src/languages/profile.js b/src/languages/profile.js
index 801d9db..68e07e5 100644
--- a/src/languages/profile.js
+++ b/src/languages/profile.js
@@ -37,11 +37,9 @@ function(hljs) {
       {
         className: 'function',
         begin: '\\(', end: '\\)$',
-        contains: [{
-          className: 'title',
-          begin: hljs.UNDERSCORE_IDENT_RE,
-          relevance: 0
-        }],
+        contains: [
+          hljs.UNDERSCORE_TITLE_MODE
+        ],
         relevance: 0
       }
     ]
diff --git a/src/languages/python.js b/src/languages/python.js
index c69d922..dbd706b 100644
--- a/src/languages/python.js
+++ b/src/languages/python.js
@@ -6,58 +6,55 @@ function(hljs) {
   var PROMPT = {
     className: 'prompt',  begin: /^(>>>|\.\.\.) /
   }
-  var STRINGS = [
-    {
-      className: 'string',
-      begin: /(u|b)?r?'''/, end: /'''/,
-      contains: [PROMPT],
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: /(u|b)?r?"""/, end: /"""/,
-      contains: [PROMPT],
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: /(u|r|ur)'/, end: /'/,
-      contains: [hljs.BACKSLASH_ESCAPE],
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: /(u|r|ur)"/, end: /"/,
-      contains: [hljs.BACKSLASH_ESCAPE],
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: /(b|br)'/, end: /'/,
-      contains: [hljs.BACKSLASH_ESCAPE]
-    },
-    {
-      className: 'string',
-      begin: /(b|br)"/, end: /"/,
-      contains: [hljs.BACKSLASH_ESCAPE]
-    }
-  ].concat([
-    hljs.APOS_STRING_MODE,
-    hljs.QUOTE_STRING_MODE
-  ]);
-  var TITLE = {
-    className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
+  var STRING = {
+    className: 'string',
+    contains: [hljs.BACKSLASH_ESCAPE],
+    variants: [
+      {
+        begin: /(u|b)?r?'''/, end: /'''/,
+        contains: [PROMPT],
+        relevance: 10
+      },
+      {
+        begin: /(u|b)?r?"""/, end: /"""/,
+        contains: [PROMPT],
+        relevance: 10
+      },
+      {
+        begin: /(u|r|ur)'/, end: /'/,
+        relevance: 10
+      },
+      {
+        begin: /(u|r|ur)"/, end: /"/,
+        relevance: 10
+      },
+      {
+        begin: /(b|br)'/, end: /'/,
+      },
+      {
+        begin: /(b|br)"/, end: /"/,
+      },
+      hljs.APOS_STRING_MODE,
+      hljs.QUOTE_STRING_MODE
+    ]
   };
+  var NUMBER = {
+    className: 'number', relevance: 0,
+    variants: [
+      {begin: hljs.BINARY_NUMBER_RE + '[lLjJ]?'},
+      {begin: '\\b(0o[0-7]+)[lLjJ]?'},
+      {begin: hljs.C_NUMBER_RE + '[lLjJ]?'}
+    ]
+  }
   var PARAMS = {
     className: 'params',
     begin: /\(/, end: /\)/,
-    contains: ['self', hljs.C_NUMBER_MODE, PROMPT].concat(STRINGS)
+    contains: ['self', PROMPT, NUMBER, STRING]
   };
   var FUNC_CLASS_PROTO = {
-    beginWithKeyword: true, end: /:/,
+    end: /:/,
     illegal: /[${=;\n]/,
-    contains: [TITLE, PARAMS],
-    relevance: 10
+    contains: [hljs.UNDERSCORE_TITLE_MODE, PARAMS]
   };
 
   return {
@@ -65,17 +62,18 @@ function(hljs) {
       keyword:
         'and elif is global as in if from raise for except finally print import pass return ' +
         'exec else break not with class assert yield try while continue del or def lambda ' +
-        'nonlocal|10',
+        'nonlocal|10 None True False',
       built_in:
-        'None True False Ellipsis NotImplemented'
+        'Ellipsis NotImplemented'
     },
     illegal: /(<\/|->|\?)/,
-    contains: STRINGS.concat([
+    contains: [
       PROMPT,
+      NUMBER,
+      STRING,
       hljs.HASH_COMMENT_MODE,
-      hljs.inherit(FUNC_CLASS_PROTO, {className: 'function', keywords: 'def'}),
-      hljs.inherit(FUNC_CLASS_PROTO, {className: 'class', keywords: 'class'}),
-      hljs.C_NUMBER_MODE,
+      hljs.inherit(FUNC_CLASS_PROTO, {className: 'function', beginKeywords: 'def', relevance: 10}),
+      hljs.inherit(FUNC_CLASS_PROTO, {className: 'class', beginKeywords: 'class'}),
       {
         className: 'decorator',
         begin: /@/, end: /$/
@@ -83,6 +81,6 @@ function(hljs) {
       {
         begin: /\b(print|exec)\(/ // don’t highlight keywords-turned-functions in Python 3
       }
-    ])
+    ]
   };
 }
diff --git a/src/languages/r.js b/src/languages/r.js
index 520a146..1d9c841 100644
--- a/src/languages/r.js
+++ b/src/languages/r.js
@@ -11,7 +11,7 @@ function(hljs) {
       hljs.HASH_COMMENT_MODE,
       {
         begin: IDENT_RE,
-        lexems: IDENT_RE,
+        lexemes: IDENT_RE,
         keywords: {
           keyword:
             'function if in break next repeat else for return switch while try tryCatch|10 ' +
@@ -63,17 +63,11 @@ function(hljs) {
 
       {
         className: 'string',
-        begin: '"',
-        end: '"',
         contains: [hljs.BACKSLASH_ESCAPE],
-        relevance: 0
-      },
-      {
-        className: 'string',
-        begin: "'",
-        end: "'",
-        contains: [hljs.BACKSLASH_ESCAPE],
-        relevance: 0
+        variants: [
+          {begin: '"', end: '"'},
+          {begin: "'", end: "'"}
+        ]
       }
     ]
   };
diff --git a/src/languages/rsl.js b/src/languages/rsl.js
index fa93aa7..0bde008 100644
--- a/src/languages/rsl.js
+++ b/src/languages/rsl.js
@@ -31,13 +31,11 @@ function(hljs) {
       },
       {
         className: 'shader',
-        beginWithKeyword: true, end: '\\(',
-        keywords: 'surface displacement light volume imager'
+        beginKeywords: 'surface displacement light volume imager', end: '\\('
       },
       {
         className: 'shading',
-        beginWithKeyword: true, end: '\\(',
-        keywords: 'illuminate illuminance gather'
+        beginKeywords: 'illuminate illuminance gather', end: '\\('
       }
     ]
   };
diff --git a/src/languages/ruby.js b/src/languages/ruby.js
index 48ae8b7..9e114f6 100644
--- a/src/languages/ruby.js
+++ b/src/languages/ruby.js
@@ -5,132 +5,88 @@ Contributors: Peter Leonov <gojpeg at yandex.ru>, Vasily Polovnyov <vast at whiteants.
 */
 
 function(hljs) {
-  var RUBY_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
   var RUBY_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
-  var RUBY_KEYWORDS = {
-    keyword:
-      'and false then defined module in return redo if BEGIN retry end for true self when ' +
-      'next until do begin unless END rescue nil else break undef not super class case ' +
-      'require yield alias while ensure elsif or include'
-  };
+  var RUBY_KEYWORDS =
+    'and false then defined module in return redo if BEGIN retry end for true self when ' +
+    'next until do begin unless END rescue nil else break undef not super class case ' +
+    'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor';
   var YARDOCTAG = {
     className: 'yardoctag',
     begin: '@[A-Za-z]+'
   };
-  var COMMENTS = [
-    {
-      className: 'comment',
-      begin: '#', end: '$',
-      contains: [YARDOCTAG]
-    },
-    {
-      className: 'comment',
-      begin: '^\\=begin', end: '^\\=end',
-      contains: [YARDOCTAG],
-      relevance: 10
-    },
-    {
-      className: 'comment',
-      begin: '^__END__', end: '\\n$'
-    }
-  ];
+  var COMMENT = {
+    className: 'comment',
+    variants: [
+      {
+        begin: '#', end: '$',
+        contains: [YARDOCTAG]
+      },
+      {
+        begin: '^\\=begin', end: '^\\=end',
+        contains: [YARDOCTAG],
+        relevance: 10
+      },
+      {
+        begin: '^__END__', end: '\\n$'
+      }
+    ]
+  };
   var SUBST = {
     className: 'subst',
     begin: '#\\{', end: '}',
-    lexems: RUBY_IDENT_RE,
     keywords: RUBY_KEYWORDS
   };
-  var STR_CONTAINS = [hljs.BACKSLASH_ESCAPE, SUBST];
-  var STRINGS = [
-    {
-      className: 'string',
-      begin: '\'', end: '\'',
-      contains: STR_CONTAINS,
-      relevance: 0
-    },
-    {
-      className: 'string',
-      begin: '"', end: '"',
-      contains: STR_CONTAINS,
-      relevance: 0
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?\\(', end: '\\)',
-      contains: STR_CONTAINS
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?\\[', end: '\\]',
-      contains: STR_CONTAINS
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?{', end: '}',
-      contains: STR_CONTAINS
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?<', end: '>',
-      contains: STR_CONTAINS,
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?/', end: '/',
-      contains: STR_CONTAINS,
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?%', end: '%',
-      contains: STR_CONTAINS,
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?-', end: '-',
-      contains: STR_CONTAINS,
-      relevance: 10
-    },
-    {
-      className: 'string',
-      begin: '%[qw]?\\|', end: '\\|',
-      contains: STR_CONTAINS,
-      relevance: 10
-    }
-  ];
-  var FUNCTION = {
-    className: 'function',
-    beginWithKeyword: true, end: ' |$|;',
-    keywords: 'def',
-    contains: [
+  var STRING = {
+    className: 'string',
+    contains: [hljs.BACKSLASH_ESCAPE, SUBST],
+    variants: [
+      {begin: /'/, end: /'/},
+      {begin: /"/, end: /"/},
+      {begin: '%[qw]?\\(', end: '\\)'},
+      {begin: '%[qw]?\\[', end: '\\]'},
+      {begin: '%[qw]?{', end: '}'},
+      {
+        begin: '%[qw]?<', end: '>',
+        relevance: 10
+      },
+      {
+        begin: '%[qw]?/', end: '/',
+        relevance: 10
+      },
+      {
+        begin: '%[qw]?%', end: '%',
+        relevance: 10
+      },
+      {
+        begin: '%[qw]?-', end: '-',
+        relevance: 10
+      },
       {
-        className: 'title',
-        begin: RUBY_METHOD_RE,
-        lexems: RUBY_IDENT_RE,
-        keywords: RUBY_KEYWORDS
+        begin: '%[qw]?\\|', end: '\\|',
+        relevance: 10
       },
       {
-        className: 'params',
-        begin: '\\(', end: '\\)',
-        lexems: RUBY_IDENT_RE,
-        keywords: RUBY_KEYWORDS
+        // \B in the beginning suppresses recognition of ?-sequences where ?
+        // is the last character of a preceding identifier, as in: `func?4`
+        begin: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/
       }
-    ].concat(COMMENTS)
+    ]
+  };
+  var PARAMS = {
+    className: 'params',
+    begin: '\\(', end: '\\)',
+    keywords: RUBY_KEYWORDS
   };
 
-  var RUBY_DEFAULT_CONTAINS = COMMENTS.concat(STRINGS.concat([
+  var RUBY_DEFAULT_CONTAINS = [
+    STRING,
+    COMMENT,
     {
       className: 'class',
-      beginWithKeyword: true, end: '$|;',
-      keywords: 'class module',
+      beginKeywords: 'class module', end: '$|;',
+      illegal: /=/,
       contains: [
-        {
-          className: 'title',
-          begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?',
-          relevance: 0
-        },
+        hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?'}),
         {
           className: 'inheritance',
           begin: '<\\s*',
@@ -138,10 +94,20 @@ function(hljs) {
             className: 'parent',
             begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE
           }]
-        }
-      ].concat(COMMENTS)
+        },
+        COMMENT
+      ]
+    },
+    {
+      className: 'function',
+      beginKeywords: 'def', end: ' |$|;',
+      relevance: 0,
+      contains: [
+        hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),
+        PARAMS,
+        COMMENT
+      ]
     },
-    FUNCTION,
     {
       className: 'constant',
       begin: '(::)?(\\b[A-Z]\\w*(::)?)+',
@@ -150,12 +116,12 @@ function(hljs) {
     {
       className: 'symbol',
       begin: ':',
-      contains: STRINGS.concat([{begin: RUBY_METHOD_RE}]),
+      contains: [STRING, {begin: RUBY_METHOD_RE}],
       relevance: 0
     },
     {
       className: 'symbol',
-      begin: RUBY_IDENT_RE + ':',
+      begin: hljs.UNDERSCORE_IDENT_RE + '(\\!|\\?)?:',
       relevance: 0
     },
     {
@@ -164,31 +130,33 @@ function(hljs) {
       relevance: 0
     },
     {
-      className: 'number',
-      begin: '\\?\\w'
-    },
-    {
       className: 'variable',
       begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))'
     },
     { // regexp container
       begin: '(' + hljs.RE_STARTERS_RE + ')\\s*',
-      contains: COMMENTS.concat([
+      contains: [
+        COMMENT,
         {
           className: 'regexp',
-          begin: '/', end: '/[a-z]*',
-          illegal: '\\n',
-          contains: [hljs.BACKSLASH_ESCAPE, SUBST]
+          contains: [hljs.BACKSLASH_ESCAPE, SUBST],
+          illegal: /\n/,
+          variants: [
+            {begin: '/', end: '/[a-z]*'},
+            {begin: '%r{', end: '}[a-z]*'},
+            {begin: '%r\\(', end: '\\)[a-z]*'},
+            {begin: '%r!', end: '![a-z]*'},
+            {begin: '%r\\[', end: '\\][a-z]*'}
+          ]
         }
-      ]),
+      ],
       relevance: 0
     }
-  ]));
+  ];
   SUBST.contains = RUBY_DEFAULT_CONTAINS;
-  FUNCTION.contains[1].contains = RUBY_DEFAULT_CONTAINS;
+  PARAMS.contains = RUBY_DEFAULT_CONTAINS;
 
   return {
-    lexems: RUBY_IDENT_RE,
     keywords: RUBY_KEYWORDS,
     contains: RUBY_DEFAULT_CONTAINS
   };
diff --git a/src/languages/ruleslanguage.js b/src/languages/ruleslanguage.js
index f112f74..6d968d9 100644
--- a/src/languages/ruleslanguage.js
+++ b/src/languages/ruleslanguage.js
@@ -8,44 +8,44 @@ 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 ' + 
+         'INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 ' +
+         'INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 ' +
+         'INTDCREATEHANDLE|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 ' + 
+         'NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH ' +
+         'IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE 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 ' +
+         'NUMDAYS 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: [
@@ -59,4 +59,4 @@ function(hljs) {
       }
     ]
   };
-}
\ No newline at end of file
+}
diff --git a/src/languages/rust.js b/src/languages/rust.js
index 8f4cc6b..766e690 100644
--- a/src/languages/rust.js
+++ b/src/languages/rust.js
@@ -4,10 +4,6 @@ Author: Andrey Vlasovskikh <andrey.vlasovskikh at gmail.com>
 */
 
 function(hljs) {
-  var TITLE = {
-    className: 'title',
-    begin: hljs.UNDERSCORE_IDENT_RE
-  };
   var NUMBER = {
     className: 'number',
     begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
@@ -30,24 +26,21 @@ function(hljs) {
       NUMBER,
       {
         className: 'function',
-        beginWithKeyword: true, end: '(\\(|<)',
-        keywords: 'fn',
-        contains: [TITLE]
+        beginKeywords: 'fn', end: '(\\(|<)',
+        contains: [hljs.UNDERSCORE_TITLE_MODE]
       },
       {
         className: 'preprocessor',
         begin: '#\\[', end: '\\]'
       },
       {
-        beginWithKeyword: true, end: '(=|<)',
-        keywords: 'type',
-        contains: [TITLE],
+        beginKeywords: 'type', end: '(=|<)',
+        contains: [hljs.UNDERSCORE_TITLE_MODE],
         illegal: '\\S'
       },
       {
-        beginWithKeyword: true, end: '({|<)',
-        keywords: 'trait enum',
-        contains: [TITLE],
+        beginKeywords: 'trait enum', end: '({|<)',
+        contains: [hljs.UNDERSCORE_TITLE_MODE],
         illegal: '\\S'
       }
     ]
diff --git a/src/languages/scala.js b/src/languages/scala.js
index 09a7205..549d6c2 100644
--- a/src/languages/scala.js
+++ b/src/languages/scala.js
@@ -28,22 +28,18 @@ function(hljs) {
         relevance: 10
       },
       hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE,
-      hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, STRING,
+      STRING, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
       {
         className: 'class',
-        begin: '((case )?class |object |trait )', end: '({|$)', // beginWithKeyword won't work because a single "case" shouldn't start this mode
+        begin: '((case )?class |object |trait )', end: '({|$)', // beginKeywords won't work because a single "case" shouldn't start this mode
         illegal: ':',
         keywords: 'case class trait object',
         contains: [
           {
-            beginWithKeyword: true,
-            keywords: 'extends with',
+            beginKeywords: 'extends with',
             relevance: 10
           },
-          {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE
-          },
+          hljs.UNDERSCORE_TITLE_MODE,
           {
             className: 'params',
             begin: '\\(', end: '\\)',
diff --git a/src/languages/scilab.js b/src/languages/scilab.js
new file mode 100644
index 0000000..ae65256
--- /dev/null
+++ b/src/languages/scilab.js
@@ -0,0 +1,63 @@
+/*
+Language: Scilab
+Author: Sylvestre Ledru <sylvestre.ledru at scilab-enterprises.com>
+Origin: matlab.js
+Description: Scilab is a port from Matlab
+*/
+
+function(hljs) {
+
+  var COMMON_CONTAINS = [
+    hljs.C_NUMBER_MODE,
+    {
+      className: 'string',
+      begin: '\'|\"', end: '\'|\"',
+      contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
+    }
+  ];
+
+  return {
+    keywords: {
+      keyword: 'abort break case clear catch continue do elseif else endfunction end for function'+
+        'global if pause return resume select try then while'+
+        '%f %F %t %T %pi %eps %inf %nan %e %i %z %s',
+      built_in: // Scilab has more than 2000 functions. Just list the most commons
+       'abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error'+
+       'exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty'+
+       'isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log'+
+       'max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real'+
+       'round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan'+
+       'type typename warning zeros matrix'
+    },
+    illegal: '("|#|/\\*|\\s+/\\w+)',
+    contains: [
+      {
+        className: 'function',
+        beginKeywords: 'function endfunction', end: '$',
+        keywords: 'function endfunction|10',
+        contains: [
+          hljs.UNDERSCORE_TITLE_MODE,
+          {
+            className: 'params',
+            begin: '\\(', end: '\\)'
+          },
+        ],
+      },
+      {
+        className: 'transposed_variable',
+        begin: '[a-zA-Z_][a-zA-Z_0-9]*(\'+[\\.\']*|[\\.\']+)', end: '',
+        relevance: 0
+      },
+      {
+        className: 'matrix',
+        begin: '\\[', end: '\\]\'*[\\.\']*',
+        relevance: 0,
+        contains: COMMON_CONTAINS
+      },
+      {
+        className: 'comment',
+        begin: '//', end: '$'
+      }
+    ].concat(COMMON_CONTAINS)
+  };
+}
diff --git a/src/languages/scss.js b/src/languages/scss.js
index 29bcc51..82e5583 100644
--- a/src/languages/scss.js
+++ b/src/languages/scss.js
@@ -95,7 +95,7 @@ function(hljs) {
       {
         className: 'at_rule',
         begin: '@', end: '[{;]',
-        keywords: 'mixin include for extend charset import media page font-face namespace',
+        keywords: 'mixin include extend for if else each while charset import debug media page content font-face namespace warn',
         contains: [
           FUNCTION,
           hljs.QUOTE_STRING_MODE,
diff --git a/src/languages/smalltalk.js b/src/languages/smalltalk.js
index 703991a..5ff8ab8 100644
--- a/src/languages/smalltalk.js
+++ b/src/languages/smalltalk.js
@@ -18,8 +18,7 @@ function(hljs) {
     contains: [
       {
         className: 'comment',
-        begin: '"', end: '"',
-        relevance: 0
+        begin: '"', end: '"'
       },
       hljs.APOS_STRING_MODE,
       {
@@ -29,7 +28,8 @@ function(hljs) {
       },
       {
         className: 'method',
-        begin: VAR_IDENT_RE + ':'
+        begin: VAR_IDENT_RE + ':',
+        relevance: 0
       },
       hljs.C_NUMBER_MODE,
       SYMBOL,
@@ -39,7 +39,10 @@ function(hljs) {
         // 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*\\|'
+        begin: '\\|[ ]*' + VAR_IDENT_RE + '([ ]+' + VAR_IDENT_RE + ')*[ ]*\\|',
+        returnBegin: true, end: /\|/,
+        illegal: /\S/,
+        contains: [{begin: '(\\|[ ]*)?' + VAR_IDENT_RE}]
       },
       {
         className: 'array',
diff --git a/src/languages/sql.js b/src/languages/sql.js
index f4083dd..5998ed4 100644
--- a/src/languages/sql.js
+++ b/src/languages/sql.js
@@ -5,10 +5,11 @@ Language: SQL
 function(hljs) {
   return {
     case_insensitive: true,
+    illegal: /[<>]/,
     contains: [
       {
         className: 'operator',
-        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
+        begin: '\\b(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|merge)\\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,21 +31,20 @@ 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 trigger if before after each row',
+            'truncate start lock show pragma exists number trigger if before after each row ' +
+            'merge matched database',
           aggregate: 'count sum min max avg'
         },
         contains: [
           {
             className: 'string',
             begin: '\'', end: '\'',
-            contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
-            relevance: 0
+            contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}]
           },
           {
             className: 'string',
             begin: '"', end: '"',
-            contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}],
-            relevance: 0
+            contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}]
           },
           {
             className: 'string',
diff --git a/src/languages/vala.js b/src/languages/vala.js
index 47c28f0..70a2571 100644
--- a/src/languages/vala.js
+++ b/src/languages/vala.js
@@ -29,14 +29,10 @@ function(hljs) {
     contains: [
       {
         className: 'class',
-        beginWithKeyword: true, end: '{',
-        keywords: 'class interface delegate namespace',
+        beginKeywords: 'class interface delegate namespace', end: '{',
         illegal: '[^,:\\n\\s\\.]',
         contains: [
-          {
-            className: 'title',
-            begin: hljs.UNDERSCORE_IDENT_RE
-          }
+          hljs.UNDERSCORE_TITLE_MODE
         ]
       },
       hljs.C_LINE_COMMENT_MODE,
diff --git a/src/languages/vbnet.js b/src/languages/vbnet.js
index 77ff988..933ff8a 100644
--- a/src/languages/vbnet.js
+++ b/src/languages/vbnet.js
@@ -26,7 +26,7 @@ function(hljs) {
       literal:
         'true false nothing'
     },
-    illegal: '(//|endif|gosub|variant|wend)', /* reserved deprecated keywords */
+    illegal: '//|{|}|endif|gosub|variant|wend', /* reserved deprecated keywords */
     contains: [
       hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
       {
diff --git a/src/languages/vbscript.js b/src/languages/vbscript.js
index 0333bc4..8adba25 100644
--- a/src/languages/vbscript.js
+++ b/src/languages/vbscript.js
@@ -32,7 +32,8 @@ function(hljs) {
       hljs.inherit(hljs.QUOTE_STRING_MODE, {contains: [{begin: '""'}]}),
       {
         className: 'comment',
-        begin: '\'', end: '$'
+        begin: /'/, end: /$/,
+        relevance: 0
       },
       hljs.C_NUMBER_MODE
     ]
diff --git a/src/languages/xml.js b/src/languages/xml.js
index 39d2fc8..092b555 100644
--- a/src/languages/xml.js
+++ b/src/languages/xml.js
@@ -4,47 +4,42 @@ Language: HTML, XML
 
 function(hljs) {
   var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
+  var PHP = {
+    begin: /<\?(php)?(?!\w)/, end: /\?>/,
+    subLanguage: 'php', subLanguageMode: 'continuous'
+  };
   var TAG_INTERNALS = {
     endsWithParent: true,
+    illegal: /</,
     relevance: 0,
     contains: [
+      PHP,
       {
         className: 'attribute',
         begin: XML_IDENT_RE,
         relevance: 0
       },
       {
-        begin: '="', returnBegin: true, end: '"',
-        contains: [{
-            className: 'value',
-            begin: '"', endsWithParent: true
-        }]
-      },
-      {
-        begin: '=\'', returnBegin: true, end: '\'',
-        contains: [{
-          className: 'value',
-          begin: '\'', endsWithParent: true
-        }]
-      },
-      {
         begin: '=',
-        contains: [{
-          className: 'value',
-          begin: '[^\\s/>]+'
-        }]
+        relevance: 0,
+        contains: [
+          {
+            className: 'value',
+            variants: [
+              {begin: /"/, end: /"/},
+              {begin: /'/, end: /'/},
+              {begin: /[^\s\/>]+/}
+            ]
+          }
+        ]
       }
     ]
   };
   return {
+    aliases: ['html'],
     case_insensitive: true,
     contains: [
       {
-        className: 'pi',
-        begin: '<\\?', end: '\\?>',
-        relevance: 10
-      },
-      {
         className: 'doctype',
         begin: '<!DOCTYPE', end: '>',
         relevance: 10,
@@ -65,8 +60,8 @@ function(hljs) {
         /*
         The lookahead pattern (?=...) ensures that 'begin' only matches
         '<style' as a single word, followed by a whitespace or an
-        ending braket. The '$' is needed for the lexem to be recognized
-        by hljs.subMode() that tests lexems outside the stream.
+        ending braket. The '$' is needed for the lexeme to be recognized
+        by hljs.subMode() that tests lexemes outside the stream.
         */
         begin: '<style(?=\\s|>|$)', end: '>',
         keywords: {title: 'style'},
@@ -91,13 +86,18 @@ function(hljs) {
         begin: '<%', end: '%>',
         subLanguage: 'vbscript'
       },
+      PHP,
+      {
+        className: 'pi',
+        begin: /<\?\w+/, end: /\?>/,
+        relevance: 10
+      },
       {
         className: 'tag',
         begin: '</?', end: '/?>',
-        relevance: 0,
         contains: [
           {
-            className: 'title', begin: '[^ /><]+'
+            className: 'title', begin: '[^ /><]+', relevance: 0
           },
           TAG_INTERNALS
         ]
diff --git a/src/package.json b/src/package.json
index e744516..64ea03e 100644
--- a/src/package.json
+++ b/src/package.json
@@ -2,19 +2,23 @@
 , "description" : "Syntax highlighting with language autodetection."
 , "keywords" : ["highlight", "syntax"]
 , "homepage" : "http://highlightjs.org/"
-, "version" : "7.4.0"
+, "version" : "8.0.0"
 , "author" :
   { "name": "Ivan Sagalaev"
   , "email": "maniac at softwaremaniacs.org"
   }
 , "contributors" : []
 , "bugs" : { "url" : "https://github.com/isagalaev/highlight.js/issues" }
-, "licenses" : [ { "type" : "BSD" } ]
+, "licenses" : [
+    { "type" : "BSD"
+    , "url" : "https://github.com/isagalaev/highlight.js/blob/master/LICENSE"
+    }
+  ]
 , "repository" :
   { "type" : "git"
   , "url" : "git://github.com/isagalaev/highlight.js.git"
   }
-, "main" : "./highlight.js"
+, "main" : "./lib/index.js"
 , "scripts" : {}
 , "engines" : { "node" : "*" }
 }
diff --git a/src/styles/arta.css b/src/styles/arta.css
index 049e383..02db86a 100644
--- a/src/styles/arta.css
+++ b/src/styles/arta.css
@@ -3,157 +3,158 @@ Date: 17.V.2011
 Author: pumbur <pumbur at pumbur.net>
 */
 
-pre code
+.hljs
 {
   display: block; padding: 0.5em;
   background: #222;
 }
 
-pre .profile .header *,
-pre .ini .title,
-pre .nginx .title
+.profile .hljs-header *,
+.ini .hljs-title,
+.nginx .hljs-title
 {
   color: #fff;
 }
 
-pre .comment,
-pre .javadoc,
-pre .preprocessor,
-pre .preprocessor .title,
-pre .shebang,
-pre .profile .summary,
-pre .diff,
-pre .pi,
-pre .doctype,
-pre .tag,
-pre .template_comment,
-pre .css .rules,
-pre .tex .special
+.hljs-comment,
+.hljs-javadoc,
+.hljs-preprocessor,
+.hljs-preprocessor .hljs-title,
+.hljs-pragma,
+.hljs-shebang,
+.profile .hljs-summary,
+.diff,
+.hljs-pi,
+.hljs-doctype,
+.hljs-tag,
+.hljs-template_comment,
+.css .hljs-rules,
+.tex .hljs-special
 {
   color: #444;
 }
 
-pre .string,
-pre .symbol,
-pre .diff .change,
-pre .regexp,
-pre .xml .attribute,
-pre .smalltalk .char,
-pre .xml .value,
-pre .ini .value,
-pre .clojure .attribute,
-pre .coffeescript .attribute
+.hljs-string,
+.hljs-symbol,
+.diff .hljs-change,
+.hljs-regexp,
+.xml .hljs-attribute,
+.smalltalk .hljs-char,
+.xml .hljs-value,
+.ini .hljs-value,
+.clojure .hljs-attribute,
+.coffeescript .hljs-attribute
 {
   color: #ffcc33;
 }
 
-pre .number,
-pre .addition
+.hljs-number,
+.hljs-addition
 {
   color: #00cc66;
 }
 
-pre .built_in,
-pre .literal,
-pre .vhdl .typename,
-pre .go .constant,
-pre .go .typename,
-pre .ini .keyword,
-pre .lua .title,
-pre .perl .variable,
-pre .php .variable,
-pre .mel .variable,
-pre .django .variable,
-pre .css .funtion,
-pre .smalltalk .method,
-pre .hexcolor,
-pre .important,
-pre .flow,
-pre .inheritance,
-pre .parser3 .variable
+.hljs-built_in,
+.hljs-literal,
+.vhdl .hljs-typename,
+.go .hljs-constant,
+.go .hljs-typename,
+.ini .hljs-keyword,
+.lua .hljs-title,
+.perl .hljs-variable,
+.php .hljs-variable,
+.mel .hljs-variable,
+.django .hljs-variable,
+.css .funtion,
+.smalltalk .method,
+.hljs-hexcolor,
+.hljs-important,
+.hljs-flow,
+.hljs-inheritance,
+.parser3 .hljs-variable
 {
   color: #32AAEE;
 }
 
-pre .keyword,
-pre .tag .title,
-pre .css .tag,
-pre .css .class,
-pre .css .id,
-pre .css .pseudo,
-pre .css .attr_selector,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .winutils,
-pre .tex .command,
-pre .request,
-pre .status
+.hljs-keyword,
+.hljs-tag .hljs-title,
+.css .hljs-tag,
+.css .hljs-class,
+.css .hljs-id,
+.css .hljs-pseudo,
+.css .hljs-attr_selector,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.hljs-winutils,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status
 {
   color: #6644aa;
 }
 
-pre .title,
-pre .ruby .constant,
-pre .vala .constant,
-pre .parent,
-pre .deletion,
-pre .template_tag,
-pre .css .keyword,
-pre .objectivec .class .id,
-pre .smalltalk .class,
-pre .lisp .keyword,
-pre .apache .tag,
-pre .nginx .variable,
-pre .envvar,
-pre .bash .variable,
-pre .go .built_in,
-pre .vbscript .built_in,
-pre .lua .built_in,
-pre .rsl .built_in,
-pre .tail,
-pre .avrasm .label,
-pre .tex .formula,
-pre .tex .formula *
+.hljs-title,
+.ruby .hljs-constant,
+.vala .hljs-constant,
+.hljs-parent,
+.hljs-deletion,
+.hljs-template_tag,
+.css .hljs-keyword,
+.objectivec .hljs-class .hljs-id,
+.smalltalk .hljs-class,
+.lisp .hljs-keyword,
+.apache .hljs-tag,
+.nginx .hljs-variable,
+.hljs-envvar,
+.bash .hljs-variable,
+.go .hljs-built_in,
+.vbscript .hljs-built_in,
+.lua .hljs-built_in,
+.rsl .hljs-built_in,
+.tail,
+.avrasm .hljs-label,
+.tex .hljs-formula,
+.tex .hljs-formula *
 {
   color: #bb1166;
 }
 
-pre .yardoctag,
-pre .phpdoc,
-pre .profile .header,
-pre .ini .title,
-pre .apache .tag,
-pre .parser3 .title
+.hljs-yardoctag,
+.hljs-phpdoc,
+.profile .hljs-header,
+.ini .hljs-title,
+.apache .hljs-tag,
+.parser3 .hljs-title
 {
   font-weight: bold;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata
 {
   opacity: 0.6;
 }
 
-pre code,
-pre .javascript,
-pre .css,
-pre .xml,
-pre .subst,
-pre .diff .chunk,
-pre .css .value,
-pre .css .attribute,
-pre .lisp .string,
-pre .lisp .number,
-pre .tail .params,
-pre .container,
-pre .haskell *,
-pre .erlang *,
-pre .erlang_repl *
+.hljs,
+.javascript,
+.css,
+.xml,
+.hljs-subst,
+.diff .hljs-chunk,
+.css .hljs-value,
+.css .hljs-attribute,
+.lisp .hljs-string,
+.lisp .hljs-number,
+.tail .hljs-params,
+.hljs-container,
+.haskell *,
+.erlang *,
+.erlang_repl *
 {
   color: #aaa;
 }
diff --git a/src/styles/ascetic.css b/src/styles/ascetic.css
index 63349b7..031c88a 100644
--- a/src/styles/ascetic.css
+++ b/src/styles/ascetic.css
@@ -4,47 +4,47 @@ Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac at SoftwareManiac
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: white; color: black;
 }
 
-pre .string,
-pre .tag .value,
-pre .filter .argument,
-pre .addition,
-pre .change,
-pre .apache .tag,
-pre .apache .cbracket,
-pre .nginx .built_in,
-pre .tex .formula {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-filter .hljs-argument,
+.hljs-addition,
+.hljs-change,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.nginx .hljs-built_in,
+.tex .hljs-formula {
   color: #888;
 }
 
-pre .comment,
-pre .template_comment,
-pre .shebang,
-pre .doctype,
-pre .pi,
-pre .javadoc,
-pre .deletion,
-pre .apache .sqbracket {
+.hljs-comment,
+.hljs-template_comment,
+.hljs-shebang,
+.hljs-doctype,
+.hljs-pi,
+.hljs-javadoc,
+.hljs-deletion,
+.apache .hljs-sqbracket {
   color: #CCC;
 }
 
-pre .keyword,
-pre .tag .title,
-pre .ini .title,
-pre .lisp .title,
-pre .clojure .title,
-pre .http .title,
-pre .nginx .title,
-pre .css .tag,
-pre .winutils,
-pre .flow,
-pre .apache .tag,
-pre .tex .command,
-pre .request,
-pre .status {
+.hljs-keyword,
+.hljs-tag .hljs-title,
+.ini .hljs-title,
+.lisp .hljs-title,
+.clojure .hljs-title,
+.http .hljs-title,
+.nginx .hljs-title,
+.css .hljs-tag,
+.hljs-winutils,
+.hljs-flow,
+.apache .hljs-tag,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status {
   font-weight: bold;
 }
diff --git a/src/styles/atelier-dune.dark.css b/src/styles/atelier-dune.dark.css
new file mode 100644
index 0000000..2779601
--- /dev/null
+++ b/src/styles/atelier-dune.dark.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Dune Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Dune Dark Comment */
+.hljs-comment,
+.hljs-title {
+  color: #999580;
+}
+
+/* Atelier Dune Dark Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #d73737;
+}
+
+/* Atelier Dune Dark Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #b65611;
+}
+
+/* Atelier Dune Dark Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #cfb017;
+}
+
+/* Atelier Dune Dark Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #60ac39;
+}
+
+/* Atelier Dune Dark Aqua */
+.css .hljs-hexcolor {
+  color: #1fad83;
+}
+
+/* Atelier Dune Dark Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #6684e1;
+}
+
+/* Atelier Dune Dark Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #b854d4;
+}
+
+.hljs {
+  display: block;
+  background: #292824;
+  color: #a6a28c;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-dune.light.css b/src/styles/atelier-dune.light.css
new file mode 100644
index 0000000..11c7423
--- /dev/null
+++ b/src/styles/atelier-dune.light.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Dune Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Dune Light Comment */
+.hljs-comment,
+.hljs-title {
+  color: #7d7a68;
+}
+
+/* Atelier Dune Light Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #d73737;
+}
+
+/* Atelier Dune Light Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #b65611;
+}
+
+/* Atelier Dune Light Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #cfb017;
+}
+
+/* Atelier Dune Light Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #60ac39;
+}
+
+/* Atelier Dune Light Aqua */
+.css .hljs-hexcolor {
+  color: #1fad83;
+}
+
+/* Atelier Dune Light Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #6684e1;
+}
+
+/* Atelier Dune Light Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #b854d4;
+}
+
+.hljs {
+  display: block;
+  background: #fefbec;
+  color: #6e6b5e;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-forest.dark.css b/src/styles/atelier-forest.dark.css
new file mode 100644
index 0000000..c1f7211
--- /dev/null
+++ b/src/styles/atelier-forest.dark.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Forest Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Forest Dark Comment */
+.hljs-comment,
+.hljs-title {
+  color: #9c9491;
+}
+
+/* Atelier Forest Dark Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #f22c40;
+}
+
+/* Atelier Forest Dark Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #df5320;
+}
+
+/* Atelier Forest Dark Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #d5911a;
+}
+
+/* Atelier Forest Dark Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #5ab738;
+}
+
+/* Atelier Forest Dark Aqua */
+.css .hljs-hexcolor {
+  color: #00ad9c;
+}
+
+/* Atelier Forest Dark Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #407ee7;
+}
+
+/* Atelier Forest Dark Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #6666ea;
+}
+
+.hljs {
+  display: block;
+  background: #2c2421;
+  color: #a8a19f;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-forest.light.css b/src/styles/atelier-forest.light.css
new file mode 100644
index 0000000..806ba73
--- /dev/null
+++ b/src/styles/atelier-forest.light.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Forest Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Forest Light Comment */
+.hljs-comment,
+.hljs-title {
+  color: #766e6b;
+}
+
+/* Atelier Forest Light Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #f22c40;
+}
+
+/* Atelier Forest Light Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #df5320;
+}
+
+/* Atelier Forest Light Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #d5911a;
+}
+
+/* Atelier Forest Light Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #5ab738;
+}
+
+/* Atelier Forest Light Aqua */
+.css .hljs-hexcolor {
+  color: #00ad9c;
+}
+
+/* Atelier Forest Light Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #407ee7;
+}
+
+/* Atelier Forest Light Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #6666ea;
+}
+
+.hljs {
+  display: block;
+  background: #f1efee;
+  color: #68615e;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-heath.dark.css b/src/styles/atelier-heath.dark.css
new file mode 100644
index 0000000..3670669
--- /dev/null
+++ b/src/styles/atelier-heath.dark.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Heath Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Heath Dark Comment */
+.hljs-comment,
+.hljs-title {
+  color: #9e8f9e;
+}
+
+/* Atelier Heath Dark Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #ca402b;
+}
+
+/* Atelier Heath Dark Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #a65926;
+}
+
+/* Atelier Heath Dark Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #bb8a35;
+}
+
+/* Atelier Heath Dark Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #379a37;
+}
+
+/* Atelier Heath Dark Aqua */
+.css .hljs-hexcolor {
+  color: #159393;
+}
+
+/* Atelier Heath Dark Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #516aec;
+}
+
+/* Atelier Heath Dark Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #7b59c0;
+}
+
+.hljs {
+  display: block;
+  background: #292329;
+  color: #ab9bab;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-heath.light.css b/src/styles/atelier-heath.light.css
new file mode 100644
index 0000000..e73a0b8
--- /dev/null
+++ b/src/styles/atelier-heath.light.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Heath Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Heath Light Comment */
+.hljs-comment,
+.hljs-title {
+  color: #776977;
+}
+
+/* Atelier Heath Light Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #ca402b;
+}
+
+/* Atelier Heath Light Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #a65926;
+}
+
+/* Atelier Heath Light Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #bb8a35;
+}
+
+/* Atelier Heath Light Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #379a37;
+}
+
+/* Atelier Heath Light Aqua */
+.css .hljs-hexcolor {
+  color: #159393;
+}
+
+/* Atelier Heath Light Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #516aec;
+}
+
+/* Atelier Heath Light Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #7b59c0;
+}
+
+.hljs {
+  display: block;
+  background: #f7f3f7;
+  color: #695d69;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-lakeside.dark.css b/src/styles/atelier-lakeside.dark.css
new file mode 100644
index 0000000..8506246
--- /dev/null
+++ b/src/styles/atelier-lakeside.dark.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Lakeside Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Lakeside Dark Comment */
+.hljs-comment,
+.hljs-title {
+  color: #7195a8;
+}
+
+/* Atelier Lakeside Dark Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #d22d72;
+}
+
+/* Atelier Lakeside Dark Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #935c25;
+}
+
+/* Atelier Lakeside Dark Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #8a8a0f;
+}
+
+/* Atelier Lakeside Dark Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #568c3b;
+}
+
+/* Atelier Lakeside Dark Aqua */
+.css .hljs-hexcolor {
+  color: #2d8f6f;
+}
+
+/* Atelier Lakeside Dark Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #257fad;
+}
+
+/* Atelier Lakeside Dark Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #5d5db1;
+}
+
+.hljs {
+  display: block;
+  background: #1f292e;
+  color: #7ea2b4;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-lakeside.light.css b/src/styles/atelier-lakeside.light.css
new file mode 100644
index 0000000..006ae6d
--- /dev/null
+++ b/src/styles/atelier-lakeside.light.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Lakeside Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Lakeside Light Comment */
+.hljs-comment,
+.hljs-title {
+  color: #5a7b8c;
+}
+
+/* Atelier Lakeside Light Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #d22d72;
+}
+
+/* Atelier Lakeside Light Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #935c25;
+}
+
+/* Atelier Lakeside Light Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #8a8a0f;
+}
+
+/* Atelier Lakeside Light Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #568c3b;
+}
+
+/* Atelier Lakeside Light Aqua */
+.css .hljs-hexcolor {
+  color: #2d8f6f;
+}
+
+/* Atelier Lakeside Light Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #257fad;
+}
+
+/* Atelier Lakeside Light Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #5d5db1;
+}
+
+.hljs {
+  display: block;
+  background: #ebf8ff;
+  color: #516d7b;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-seaside.dark.css b/src/styles/atelier-seaside.dark.css
new file mode 100644
index 0000000..cbea6ed
--- /dev/null
+++ b/src/styles/atelier-seaside.dark.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Seaside Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Seaside Dark Comment */
+.hljs-comment,
+.hljs-title {
+  color: #809980;
+}
+
+/* Atelier Seaside Dark Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #e6193c;
+}
+
+/* Atelier Seaside Dark Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #87711d;
+}
+
+/* Atelier Seaside Dark Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #c3c322;
+}
+
+/* Atelier Seaside Dark Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #29a329;
+}
+
+/* Atelier Seaside Dark Aqua */
+.css .hljs-hexcolor {
+  color: #1999b3;
+}
+
+/* Atelier Seaside Dark Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #3d62f5;
+}
+
+/* Atelier Seaside Dark Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #ad2bee;
+}
+
+.hljs {
+  display: block;
+  background: #242924;
+  color: #8ca68c;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/atelier-seaside.light.css b/src/styles/atelier-seaside.light.css
new file mode 100644
index 0000000..159121e
--- /dev/null
+++ b/src/styles/atelier-seaside.light.css
@@ -0,0 +1,93 @@
+/* Base16 Atelier Seaside Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/) */ 
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+/* https://github.com/jmblog/color-themes-for-highlightjs */
+
+/* Atelier Seaside Light Comment */
+.hljs-comment,
+.hljs-title {
+  color: #687d68;
+}
+
+/* Atelier Seaside Light Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #e6193c;
+}
+
+/* Atelier Seaside Light Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #87711d;
+}
+
+/* Atelier Seaside Light Yellow */
+.hljs-ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #c3c322;
+}
+
+/* Atelier Seaside Light Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #29a329;
+}
+
+/* Atelier Seaside Light Aqua */
+.css .hljs-hexcolor {
+  color: #1999b3;
+}
+
+/* Atelier Seaside Light Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #3d62f5;
+}
+
+/* Atelier Seaside Light Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #ad2bee;
+}
+
+.hljs {
+  display: block;
+  background: #f0fff0;
+  color: #5e6e5e;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/brown_paper.css b/src/styles/brown_paper.css
index 23476da..f9541c3 100644
--- a/src/styles/brown_paper.css
+++ b/src/styles/brown_paper.css
@@ -4,101 +4,102 @@ Brown Paper style from goldblog.com.ua (c) Zaripov Yura <yur4ik7 at ukr.net>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background:#b7a68e url(./brown_papersq.png);
 }
 
-pre .keyword,
-pre .literal,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tex .special,
-pre .request,
-pre .status {
+.hljs-keyword,
+.hljs-literal,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.tex .hljs-special,
+.hljs-request,
+.hljs-status {
   color:#005599;
   font-weight:bold;
 }
 
-pre code,
-pre .subst,
-pre .tag .keyword {
+.hljs,
+.hljs-subst,
+.hljs-tag .hljs-keyword {
   color: #363C69;
 }
 
-pre .string,
-pre .title,
-pre .haskell .type,
-pre .tag .value,
-pre .css .rules .value,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .ruby .class .parent,
-pre .built_in,
-pre .sql .aggregate,
-pre .django .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .javadoc,
-pre .ruby .string,
-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 .number {
+.hljs-string,
+.hljs-title,
+.haskell .hljs-type,
+.hljs-tag .hljs-value,
+.css .hljs-rules .hljs-value,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.ruby .hljs-string,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-number {
   color: #2C009F;
 }
 
-pre .comment,
-pre .java .annotation,
-pre .python .decorator,
-pre .template_comment,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .shebang,
-pre .apache .sqbracket,
-pre .nginx .built_in,
-pre .tex .formula {
+.hljs-comment,
+.java .hljs-annotation,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in,
+.tex .hljs-formula {
   color: #802022;
 }
 
-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 .command {
+.hljs-keyword,
+.hljs-literal,
+.css .hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-command {
   font-weight: bold;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.8;
 }
diff --git a/src/styles/dark.css b/src/styles/dark.css
index 0a00163..e479d0a 100644
--- a/src/styles/dark.css
+++ b/src/styles/dark.css
@@ -4,101 +4,102 @@ Dark style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac at SoftwareManiacs.Or
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #444;
 }
 
-pre .keyword,
-pre .literal,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tex .special {
+.hljs-keyword,
+.hljs-literal,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.tex .hljs-special {
   color: white;
 }
 
-pre code,
-pre .subst {
+.hljs,
+.hljs-subst {
   color: #DDD;
 }
 
-pre .string,
-pre .title,
-pre .haskell .type,
-pre .ini .title,
-pre .tag .value,
-pre .css .rules .value,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .ruby .class .parent,
-pre .built_in,
-pre .sql .aggregate,
-pre .django .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .javadoc,
-pre .ruby .string,
-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,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-title,
+.haskell .hljs-type,
+.ini .hljs-title,
+.hljs-tag .hljs-value,
+.css .hljs-rules .hljs-value,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.ruby .hljs-string,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.hljs-prompt,
+.coffeescript .hljs-attribute {
   color: #D88;
 }
 
-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 {
+.hljs-comment,
+.java .hljs-annotation,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
   color: #777;
 }
 
-pre .keyword,
-pre .literal,
-pre .title,
-pre .css .id,
-pre .phpdoc,
-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 {
+.hljs-keyword,
+.hljs-literal,
+.hljs-title,
+.css .hljs-id,
+.hljs-phpdoc,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-special,
+.hljs-request,
+.hljs-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 {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/default.css b/src/styles/default.css
index 1a74220..3d8485b 100644
--- a/src/styles/default.css
+++ b/src/styles/default.css
@@ -4,146 +4,150 @@ Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac at SoftwareManiac
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #F0F0F0;
 }
 
-pre code,
-pre .subst,
-pre .tag .title,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title {
+.hljs,
+.hljs-subst,
+.hljs-tag .hljs-title,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title {
   color: black;
 }
 
-pre .string,
-pre .title,
-pre .constant,
-pre .parent,
-pre .tag .value,
-pre .rules .value,
-pre .rules .value .number,
-pre .preprocessor,
-pre .haml .symbol,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .aggregate,
-pre .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .addition,
-pre .flow,
-pre .stream,
-pre .bash .variable,
-pre .apache .tag,
-pre .apache .cbracket,
-pre .tex .command,
-pre .tex .special,
-pre .erlang_repl .function_or_atom,
-pre .asciidoc .header,
-pre .markdown .header,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-title,
+.hljs-constant,
+.hljs-parent,
+.hljs-tag .hljs-value,
+.hljs-rules .hljs-value,
+.hljs-rules .hljs-value .hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.haml .hljs-symbol,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-aggregate,
+.hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-addition,
+.hljs-flow,
+.hljs-stream,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.tex .hljs-special,
+.erlang_repl .hljs-function_or_atom,
+.asciidoc .hljs-header,
+.markdown .hljs-header,
+.coffeescript .hljs-attribute {
   color: #800;
 }
 
-pre .comment,
-pre .annotation,
-pre .template_comment,
-pre .diff .header,
-pre .chunk,
-pre .asciidoc .blockquote,
-pre .markdown .blockquote {
+.smartquote,
+.hljs-comment,
+.hljs-annotation,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-chunk,
+.asciidoc .hljs-blockquote,
+.markdown .hljs-blockquote {
   color: #888;
 }
 
-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 {
+.hljs-number,
+.hljs-date,
+.hljs-regexp,
+.hljs-literal,
+.hljs-hexcolor,
+.smalltalk .hljs-symbol,
+.smalltalk .hljs-char,
+.go .hljs-constant,
+.hljs-change,
+.lasso .hljs-variable,
+.makefile .hljs-variable,
+.asciidoc .hljs-bullet,
+.markdown .hljs-bullet,
+.asciidoc .hljs-link_url,
+.markdown .hljs-link_url {
   color: #080;
 }
 
-pre .label,
-pre .javadoc,
-pre .ruby .string,
-pre .decorator,
-pre .filter .argument,
-pre .localvars,
-pre .array,
-pre .attr_selector,
-pre .important,
-pre .pseudo,
-pre .pi,
-pre .haml .bullet,
-pre .doctype,
-pre .deletion,
-pre .envvar,
-pre .shebang,
-pre .apache .sqbracket,
-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 {
+.hljs-label,
+.hljs-javadoc,
+.ruby .hljs-string,
+.hljs-decorator,
+.hljs-filter .hljs-argument,
+.hljs-localvars,
+.hljs-array,
+.hljs-attr_selector,
+.hljs-important,
+.hljs-pseudo,
+.hljs-pi,
+.haml .hljs-bullet,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-envvar,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in,
+.tex .hljs-formula,
+.erlang_repl .hljs-reserved,
+.hljs-prompt,
+.asciidoc .hljs-link_label,
+.markdown .hljs-link_label,
+.vhdl .hljs-attribute,
+.clojure .hljs-attribute,
+.asciidoc .hljs-attribute,
+.lasso .hljs-attribute,
+.coffeescript .hljs-property,
+.hljs-phony {
   color: #88F
 }
 
-pre .keyword,
-pre .id,
-pre .title,
-pre .built_in,
-pre .aggregate,
-pre .css .tag,
-pre .javadoctag,
-pre .phpdoc,
-pre .yardoctag,
-pre .smalltalk .class,
-pre .winutils,
-pre .bash .variable,
-pre .apache .tag,
-pre .go .typename,
-pre .tex .command,
-pre .asciidoc .strong,
-pre .markdown .strong,
-pre .request,
-pre .status {
+.hljs-keyword,
+.hljs-id,
+.hljs-title,
+.hljs-built_in,
+.hljs-aggregate,
+.css .hljs-tag,
+.hljs-javadoctag,
+.hljs-phpdoc,
+.hljs-yardoctag,
+.smalltalk .hljs-class,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.go .hljs-typename,
+.tex .hljs-command,
+.asciidoc .hljs-strong,
+.markdown .hljs-strong,
+.hljs-request,
+.hljs-status {
   font-weight: bold;
 }
 
-pre .asciidoc .emphasis,
-pre .markdown .emphasis {
+.asciidoc .hljs-emphasis,
+.markdown .hljs-emphasis {
   font-style: italic;
 }
 
-pre .nginx .built_in {
+.nginx .hljs-built_in {
   font-weight: normal;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .lasso .markup,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.lasso .markup,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/docco.css b/src/styles/docco.css
index 8515996..993fd26 100644
--- a/src/styles/docco.css
+++ b/src/styles/docco.css
@@ -2,130 +2,131 @@
 Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   color: #000;
   background: #f8f8ff
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-javadoc {
   color: #408080;
   font-style: italic
 }
 
-pre .keyword,
-pre .assignment,
-pre .literal,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
+.hljs-keyword,
+.assignment,
+.hljs-literal,
+.css .rule .hljs-keyword,
+.hljs-winutils,
+.javascript .hljs-title,
+.lisp .hljs-title,
+.hljs-subst {
   color: #954121;
 }
 
-pre .number,
-pre .hexcolor {
+.hljs-number,
+.hljs-hexcolor {
   color: #40a070
 }
 
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula {
   color: #219161;
 }
 
-pre .title,
-pre .id {
+.hljs-title,
+.hljs-id {
   color: #19469D;
 }
-pre .params {
+.hljs-params {
   color: #00F;
 }
 
-pre .javascript .title,
-pre .lisp .title,
-pre .subst {
+.javascript .hljs-title,
+.lisp .hljs-title,
+.hljs-subst {
   font-weight: normal
 }
 
-pre .class .title,
-pre .haskell .label,
-pre .tex .command {
+.hljs-class .hljs-title,
+.haskell .hljs-label,
+.tex .hljs-command {
   color: #458;
   font-weight: bold
 }
 
-pre .tag,
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword {
+.hljs-tag,
+.hljs-tag .hljs-title,
+.hljs-rules .hljs-property,
+.django .hljs-tag .hljs-keyword {
   color: #000080;
   font-weight: normal
 }
 
-pre .attribute,
-pre .variable,
-pre .instancevar,
-pre .lisp .body {
+.hljs-attribute,
+.hljs-variable,
+.instancevar,
+.lisp .hljs-body {
   color: #008080
 }
 
-pre .regexp {
+.hljs-regexp {
   color: #B68
 }
 
-pre .class {
+.hljs-class {
   color: #458;
   font-weight: bold
 }
 
-pre .symbol,
-pre .ruby .symbol .string,
-pre .ruby .symbol .keyword,
-pre .ruby .symbol .keymethods,
-pre .lisp .keyword,
-pre .tex .special,
-pre .input_number {
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-symbol .hljs-keyword,
+.ruby .hljs-symbol .keymethods,
+.lisp .hljs-keyword,
+.tex .hljs-special,
+.input_number {
   color: #990073
 }
 
-pre .builtin,
-pre .constructor,
-pre .built_in,
-pre .lisp .title {
+.builtin,
+.constructor,
+.hljs-built_in,
+.lisp .hljs-title {
   color: #0086b3
 }
 
-pre .preprocessor,
-pre .pi,
-pre .doctype,
-pre .shebang,
-pre .cdata {
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-pi,
+.hljs-doctype,
+.hljs-shebang,
+.hljs-cdata {
   color: #999;
   font-weight: bold
 }
 
-pre .deletion {
+.hljs-deletion {
   background: #fdd
 }
 
-pre .addition {
+.hljs-addition {
   background: #dfd
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background: #0086b3
 }
 
-pre .chunk {
+.hljs-chunk {
   color: #aaa
 }
 
-pre .tex .formula {
+.tex .hljs-formula {
   opacity: 0.5;
 }
diff --git a/src/styles/far.css b/src/styles/far.css
index 0b532c1..ecac3c9 100644
--- a/src/styles/far.css
+++ b/src/styles/far.css
@@ -4,109 +4,110 @@ FAR Style (c) MajestiC <majestic2k at gmail.com>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #000080;
 }
 
-pre code,
-pre .subst {
+.hljs,
+.hljs-subst {
   color: #0FF;
 }
 
-pre .string,
-pre .ruby .string,
-pre .haskell .type,
-pre .tag .value,
-pre .css .rules .value,
-pre .css .rules .value .number,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .built_in,
-pre .sql .aggregate,
-pre .django .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .addition,
-pre .apache .tag,
-pre .apache .cbracket,
-pre .tex .command,
-pre .clojure .title,
-pre .coffeescript .attribute {
+.hljs-string,
+.ruby .hljs-string,
+.haskell .hljs-type,
+.hljs-tag .hljs-value,
+.css .hljs-rules .hljs-value,
+.css .hljs-rules .hljs-value .hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-addition,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.clojure .hljs-title,
+.coffeescript .hljs-attribute {
   color: #FF0;
 }
 
-pre .keyword,
-pre .css .id,
-pre .title,
-pre .haskell .type,
-pre .vbscript .built_in,
-pre .sql .aggregate,
-pre .rsl .built_in,
-pre .smalltalk .class,
-pre .xml .tag .title,
-pre .winutils,
-pre .flow,
-pre .change,
-pre .envvar,
-pre .bash .variable,
-pre .tex .special,
-pre .clojure .built_in {
+.hljs-keyword,
+.css .hljs-id,
+.hljs-title,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.xml .hljs-tag .hljs-title,
+.hljs-winutils,
+.hljs-flow,
+.hljs-change,
+.hljs-envvar,
+.bash .hljs-variable,
+.tex .hljs-special,
+.clojure .hljs-built_in {
   color: #FFF;
 }
 
-pre .comment,
-pre .phpdoc,
-pre .javadoc,
-pre .java .annotation,
-pre .template_comment,
-pre .deletion,
-pre .apache .sqbracket,
-pre .tex .formula {
+.hljs-comment,
+.hljs-phpdoc,
+.hljs-javadoc,
+.java .hljs-annotation,
+.hljs-template_comment,
+.hljs-deletion,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
   color: #888;
 }
 
-pre .number,
-pre .date,
-pre .regexp,
-pre .literal,
-pre .smalltalk .symbol,
-pre .smalltalk .char,
-pre .clojure .attribute {
+.hljs-number,
+.hljs-date,
+.hljs-regexp,
+.hljs-literal,
+.smalltalk .hljs-symbol,
+.smalltalk .hljs-char,
+.clojure .hljs-attribute {
   color: #0F0;
 }
 
-pre .python .decorator,
-pre .django .filter .argument,
-pre .smalltalk .localvars,
-pre .smalltalk .array,
-pre .attr_selector,
-pre .pseudo,
-pre .xml .pi,
-pre .diff .header,
-pre .chunk,
-pre .shebang,
-pre .nginx .built_in,
-pre .prompt {
+.python .hljs-decorator,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.xml .hljs-pi,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-shebang,
+.nginx .hljs-built_in,
+.hljs-prompt {
   color: #008080;
 }
 
-pre .keyword,
-pre .css .id,
-pre .title,
-pre .haskell .type,
-pre .vbscript .built_in,
-pre .sql .aggregate,
-pre .rsl .built_in,
-pre .smalltalk .class,
-pre .winutils,
-pre .flow,
-pre .apache .tag,
-pre .nginx .built_in,
-pre .tex .command,
-pre .tex .special,
-pre .request,
-pre .status {
+.hljs-keyword,
+.css .hljs-id,
+.hljs-title,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.hljs-winutils,
+.hljs-flow,
+.apache .hljs-tag,
+.nginx .hljs-built_in,
+.tex .hljs-command,
+.tex .hljs-special,
+.hljs-request,
+.hljs-status {
   font-weight: bold;
 }
diff --git a/src/styles/foundation.css b/src/styles/foundation.css
index d97b47e..bc8d4df 100644
--- a/src/styles/foundation.css
+++ b/src/styles/foundation.css
@@ -6,108 +6,128 @@ Version: 1.0
 Date: 2013-04-02
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #eee;
 }
 
-pre .decorator,
-pre .annotation {
+.hljs-header,
+.hljs-decorator,
+.hljs-annotation {
   color: #000077;
 }
 
-pre .attribute {
+.hljs-horizontal_rule,
+.hljs-link_url,
+.hljs-emphasis,
+.hljs-attribute {
   color: #070;
 }
 
-pre .value,
-pre .string,
-pre .scss .value .string {
+.hljs-emphasis {
+  font-style: italic;
+}
+
+.hljs-link_label,
+.hljs-strong,
+.hljs-value,
+.hljs-string,
+.scss .hljs-value .hljs-string {
   color: #d14;
 }
 
-pre .comment {
+.hljs-strong {
+  font-weight: bold;
+}
+
+.hljs-blockquote,
+.hljs-comment {
   color: #998;
   font-style: italic;
 }
 
-pre .function .title {
+.asciidoc .hljs-title,
+.hljs-function .hljs-title {
   color: #900;
 }
 
-pre .class {
+.hljs-class {
   color: #458;
 }
 
-pre .id,
-pre .pseudo,
-pre .constant,
-pre .hexcolor {
+.hljs-id,
+.hljs-pseudo,
+.hljs-constant,
+.hljs-hexcolor {
   color: teal;
 }
 
-pre .variable {
+.hljs-variable {
   color: #336699;
 }
 
-pre .javadoc {
+.hljs-bullet,
+.hljs-javadoc {
   color: #997700;
 }
 
-pre .pi,
-pre .doctype {
+.hljs-pi,
+.hljs-doctype {
   color: #3344bb;
 }
 
-pre .number {
+.hljs-code,
+.hljs-number {
   color: #099;
 }
 
-pre .important {
+.hljs-important {
   color: #f00;
 }
 
-pre .label {
+.smartquote,
+.hljs-label {
   color: #970;
 }
 
-pre .preprocessor {
+.hljs-preprocessor,
+.hljs-pragma {
   color: #579;
 }
 
-pre .reserved,
-pre .keyword,
-pre .scss .value {
+.hljs-reserved,
+.hljs-keyword,
+.scss .hljs-value {
   color: #000;
 }
 
-pre .regexp {
+.hljs-regexp {
   background-color: #fff0ff;
   color: #880088;
 }
 
-pre .symbol {
+.hljs-symbol {
   color: #990073;
 }
 
-pre .symbol .string {
+.hljs-symbol .hljs-string {
   color: #a60;
 }
 
-pre .tag {
+.hljs-tag {
   color: #007700;
 }
 
-pre .at_rule,
-pre .at_rule .keyword {
+.hljs-at_rule,
+.hljs-at_rule .hljs-keyword {
   color: #088;
 }
 
-pre .at_rule .preprocessor {
+.hljs-at_rule .hljs-preprocessor {
   color: #808;
 }
 
-pre .scss .tag,
-pre .scss .attribute {
+.scss .hljs-tag,
+.scss .hljs-attribute {
   color: #339;
 }
diff --git a/src/styles/github.css b/src/styles/github.css
index d292d82..71967a3 100644
--- a/src/styles/github.css
+++ b/src/styles/github.css
@@ -4,126 +4,122 @@ github.com style (c) Vasily Polovnyov <vast at whiteants.net>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   color: #333;
-  background: #f8f8ff
+  background: #f8f8f8
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-javadoc {
   color: #998;
   font-style: italic
 }
 
-pre .keyword,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .nginx .title,
-pre .subst,
-pre .request,
-pre .status {
+.hljs-keyword,
+.css .rule .hljs-keyword,
+.hljs-winutils,
+.javascript .hljs-title,
+.nginx .hljs-title,
+.hljs-subst,
+.hljs-request,
+.hljs-status {
   color: #333;
   font-weight: bold
 }
 
-pre .number,
-pre .hexcolor,
-pre .ruby .constant {
+.hljs-number,
+.hljs-hexcolor,
+.ruby .hljs-constant {
   color: #099;
 }
 
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula {
   color: #d14
 }
 
-pre .title,
-pre .id,
-pre .coffeescript .params,
-pre .scss .preprocessor {
+.hljs-title,
+.hljs-id,
+.coffeescript .hljs-params,
+.scss .hljs-preprocessor {
   color: #900;
   font-weight: bold
 }
 
-pre .javascript .title,
-pre .lisp .title,
-pre .clojure .title,
-pre .subst {
+.javascript .hljs-title,
+.lisp .hljs-title,
+.clojure .hljs-title,
+.hljs-subst {
   font-weight: normal
 }
 
-pre .class .title,
-pre .haskell .type,
-pre .vhdl .literal,
-pre .tex .command {
+.hljs-class .hljs-title,
+.haskell .hljs-type,
+.vhdl .hljs-literal,
+.tex .hljs-command {
   color: #458;
   font-weight: bold
 }
 
-pre .tag,
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword {
+.hljs-tag,
+.hljs-tag .hljs-title,
+.hljs-rules .hljs-property,
+.django .hljs-tag .hljs-keyword {
   color: #000080;
   font-weight: normal
 }
 
-pre .attribute,
-pre .variable,
-pre .lisp .body {
+.hljs-attribute,
+.hljs-variable,
+.lisp .hljs-body {
   color: #008080
 }
 
-pre .regexp {
+.hljs-regexp {
   color: #009926
 }
 
-pre .class {
-  color: #458;
-  font-weight: bold
-}
-
-pre .symbol,
-pre .ruby .symbol .string,
-pre .lisp .keyword,
-pre .tex .special,
-pre .prompt {
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.lisp .hljs-keyword,
+.tex .hljs-special,
+.hljs-prompt {
   color: #990073
 }
 
-pre .built_in,
-pre .lisp .title,
-pre .clojure .built_in {
+.hljs-built_in,
+.lisp .hljs-title,
+.clojure .hljs-built_in {
   color: #0086b3
 }
 
-pre .preprocessor,
-pre .pi,
-pre .doctype,
-pre .shebang,
-pre .cdata {
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-pi,
+.hljs-doctype,
+.hljs-shebang,
+.hljs-cdata {
   color: #999;
   font-weight: bold
 }
 
-pre .deletion {
+.hljs-deletion {
   background: #fdd
 }
 
-pre .addition {
+.hljs-addition {
   background: #dfd
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background: #0086b3
 }
 
-pre .chunk {
+.hljs-chunk {
   color: #aaa
 }
diff --git a/src/styles/googlecode.css b/src/styles/googlecode.css
index 43b1ec6..45b8b3b 100644
--- a/src/styles/googlecode.css
+++ b/src/styles/googlecode.css
@@ -4,142 +4,144 @@ Google Code style (c) Aahan Krish <geekpanth3r at gmail.com>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: white; color: black;
 }
 
-pre .comment,
-pre .template_comment,
-pre .javadoc,
-pre .comment * {
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc,
+.hljs-comment * {
   color: #800;
 }
 
-pre .keyword,
-pre .method,
-pre .list .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tag .title,
-pre .setting .value,
-pre .winutils,
-pre .tex .command,
-pre .http .title,
-pre .request,
-pre .status {
+.hljs-keyword,
+.method,
+.hljs-list .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.hljs-tag .hljs-title,
+.setting .hljs-value,
+.hljs-winutils,
+.tex .hljs-command,
+.http .hljs-title,
+.hljs-request,
+.hljs-status {
   color: #008;
 }
 
-pre .envvar,
-pre .tex .special {
+.hljs-envvar,
+.tex .hljs-special {
   color: #660;
 }
 
-pre .string,
-pre .tag .value,
-pre .cdata,
-pre .filter .argument,
-pre .attr_selector,
-pre .apache .cbracket,
-pre .date,
-pre .regexp,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-cdata,
+.hljs-filter .hljs-argument,
+.hljs-attr_selector,
+.apache .hljs-cbracket,
+.hljs-date,
+.hljs-regexp,
+.coffeescript .hljs-attribute {
   color: #080;
 }
 
-pre .sub .identifier,
-pre .pi,
-pre .tag,
-pre .tag .keyword,
-pre .decorator,
-pre .ini .title,
-pre .shebang,
-pre .prompt,
-pre .hexcolor,
-pre .rules .value,
-pre .css .value .number,
-pre .literal,
-pre .symbol,
-pre .ruby .symbol .string,
-pre .number,
-pre .css .function,
-pre .clojure .attribute {
+.hljs-sub .hljs-identifier,
+.hljs-pi,
+.hljs-tag,
+.hljs-tag .hljs-keyword,
+.hljs-decorator,
+.ini .hljs-title,
+.hljs-shebang,
+.hljs-prompt,
+.hljs-hexcolor,
+.hljs-rules .hljs-value,
+.css .hljs-value .hljs-number,
+.hljs-literal,
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-number,
+.css .hljs-function,
+.clojure .hljs-attribute {
   color: #066;
 }
 
-pre .class .title,
-pre .haskell .type,
-pre .smalltalk .class,
-pre .javadoctag,
-pre .yardoctag,
-pre .phpdoc,
-pre .typename,
-pre .tag .attribute,
-pre .doctype,
-pre .class .id,
-pre .built_in,
-pre .setting,
-pre .params,
-pre .variable,
-pre .clojure .title {
+.hljs-class .hljs-title,
+.haskell .hljs-type,
+.smalltalk .hljs-class,
+.hljs-javadoctag,
+.hljs-yardoctag,
+.hljs-phpdoc,
+.hljs-typename,
+.hljs-tag .hljs-attribute,
+.hljs-doctype,
+.hljs-class .hljs-id,
+.hljs-built_in,
+.setting,
+.hljs-params,
+.hljs-variable,
+.clojure .hljs-title {
   color: #606;
 }
 
-pre .css .tag,
-pre .rules .property,
-pre .pseudo,
-pre .subst {
+.css .hljs-tag,
+.hljs-rules .hljs-property,
+.hljs-pseudo,
+.hljs-subst {
   color: #000;
 }
 
-pre .css .class, pre .css .id {
+.css .hljs-class,
+.css .hljs-id {
   color: #9B703F;
 }
 
-pre .value .important {
+.hljs-value .hljs-important {
   color: #ff7700;
   font-weight: bold;
 }
 
-pre .rules .keyword {
+.hljs-rules .hljs-keyword {
   color: #C5AF75;
 }
 
-pre .annotation,
-pre .apache .sqbracket,
-pre .nginx .built_in {
+.hljs-annotation,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in {
   color: #9B859D;
 }
 
-pre .preprocessor,
-pre .preprocessor * {
+.hljs-preprocessor,
+.hljs-preprocessor *,
+.hljs-pragma {
   color: #444;
 }
 
-pre .tex .formula {
+.tex .hljs-formula {
   background-color: #EEE;
   font-style: italic;
 }
 
-pre .diff .header,
-pre .chunk {
+.diff .hljs-header,
+.hljs-chunk {
   color: #808080;
   font-weight: bold;
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background-color: #BCCFF9;
 }
 
-pre .addition {
+.hljs-addition {
   background-color: #BAEEBA;
 }
 
-pre .deletion {
+.hljs-deletion {
   background-color: #FFC8BD;
 }
 
-pre .comment .yardoctag {
+.hljs-comment .hljs-yardoctag {
   font-weight: bold;
 }
diff --git a/src/styles/idea.css b/src/styles/idea.css
index 94515c2..77352f4 100644
--- a/src/styles/idea.css
+++ b/src/styles/idea.css
@@ -4,118 +4,119 @@ Intellij Idea-like styling (c) Vasily Polovnyov <vast at whiteants.net>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   color: #000;
   background: #fff;
 }
 
-pre .subst,
-pre .title {
+.hljs-subst,
+.hljs-title {
   font-weight: normal;
   color: #000;
 }
 
-pre .comment,
-pre .template_comment,
-pre .javadoc,
-pre .diff .header {
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc,
+.diff .hljs-header {
   color: #808080;
   font-style: italic;
 }
 
-pre .annotation,
-pre .decorator,
-pre .preprocessor,
-pre .doctype,
-pre .pi,
-pre .chunk,
-pre .shebang,
-pre .apache .cbracket,
-pre .prompt,
-pre .http .title {
+.hljs-annotation,
+.hljs-decorator,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-doctype,
+.hljs-pi,
+.hljs-chunk,
+.hljs-shebang,
+.apache .hljs-cbracket,
+.hljs-prompt,
+.http .hljs-title {
   color: #808000;
 }
 
-pre .tag,
-pre .pi {
+.hljs-tag,
+.hljs-pi {
   background: #efefef;
 }
 
-pre .tag .title,
-pre .id,
-pre .attr_selector,
-pre .pseudo,
-pre .literal,
-pre .keyword,
-pre .hexcolor,
-pre .css .function,
-pre .ini .title,
-pre .css .class,
-pre .list .title,
-pre .clojure .title,
-pre .nginx .title,
-pre .tex .command,
-pre .request,
-pre .status {
+.hljs-tag .hljs-title,
+.hljs-id,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-literal,
+.hljs-keyword,
+.hljs-hexcolor,
+.css .hljs-function,
+.ini .hljs-title,
+.css .hljs-class,
+.hljs-list .hljs-title,
+.clojure .hljs-title,
+.nginx .hljs-title,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status {
   font-weight: bold;
   color: #000080;
 }
 
-pre .attribute,
-pre .rules .keyword,
-pre .number,
-pre .date,
-pre .regexp,
-pre .tex .special {
+.hljs-attribute,
+.hljs-rules .hljs-keyword,
+.hljs-number,
+.hljs-date,
+.hljs-regexp,
+.tex .hljs-special {
   font-weight: bold;
   color: #0000ff;
 }
 
-pre .number,
-pre .regexp {
+.hljs-number,
+.hljs-regexp {
   font-weight: normal;
 }
 
-pre .string,
-pre .value,
-pre .filter .argument,
-pre .css .function .params,
-pre .apache .tag {
+.hljs-string,
+.hljs-value,
+.hljs-filter .hljs-argument,
+.css .hljs-function .hljs-params,
+.apache .hljs-tag {
   color: #008000;
   font-weight: bold;
 }
 
-pre .symbol,
-pre .ruby .symbol .string,
-pre .char,
-pre .tex .formula {
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-char,
+.tex .hljs-formula {
   color: #000;
   background: #d0eded;
   font-style: italic;
 }
 
-pre .phpdoc,
-pre .yardoctag,
-pre .javadoctag {
+.hljs-phpdoc,
+.hljs-yardoctag,
+.hljs-javadoctag {
   text-decoration: underline;
 }
 
-pre .variable,
-pre .envvar,
-pre .apache .sqbracket,
-pre .nginx .built_in {
+.hljs-variable,
+.hljs-envvar,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in {
   color: #660e7a;
 }
 
-pre .addition {
+.hljs-addition {
   background: #baeeba;
 }
 
-pre .deletion {
+.hljs-deletion {
   background: #ffc8bd;
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background: #bccff9;
 }
diff --git a/src/styles/ir_black.css b/src/styles/ir_black.css
index 9168283..cc64ef5 100644
--- a/src/styles/ir_black.css
+++ b/src/styles/ir_black.css
@@ -2,104 +2,104 @@
   IR_Black style (c) Vasily Mikhailitchenko <vaskas at programica.ru>
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #000; color: #f8f8f8;
 }
 
-pre .shebang,
-pre .comment,
-pre .template_comment,
-pre .javadoc {
+.hljs-shebang,
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc {
   color: #7c7c7c;
 }
 
-pre .keyword,
-pre .tag,
-pre .tex .command,
-pre .request,
-pre .status,
-pre .clojure .attribute {
+.hljs-keyword,
+.hljs-tag,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status,
+.clojure .hljs-attribute {
   color: #96CBFE;
 }
 
-pre .sub .keyword,
-pre .method,
-pre .list .title,
-pre .nginx .title {
+.hljs-sub .hljs-keyword,
+.method,
+.hljs-list .hljs-title,
+.nginx .hljs-title {
   color: #FFFFB6;
 }
 
-pre .string,
-pre .tag .value,
-pre .cdata,
-pre .filter .argument,
-pre .attr_selector,
-pre .apache .cbracket,
-pre .date,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-cdata,
+.hljs-filter .hljs-argument,
+.hljs-attr_selector,
+.apache .hljs-cbracket,
+.hljs-date,
+.coffeescript .hljs-attribute {
   color: #A8FF60;
 }
 
-pre .subst {
+.hljs-subst {
   color: #DAEFA3;
 }
 
-pre .regexp {
+.hljs-regexp {
   color: #E9C062;
 }
 
-pre .title,
-pre .sub .identifier,
-pre .pi,
-pre .decorator,
-pre .tex .special,
-pre .haskell .type,
-pre .constant,
-pre .smalltalk .class,
-pre .javadoctag,
-pre .yardoctag,
-pre .phpdoc,
-pre .nginx .built_in {
+.hljs-title,
+.hljs-sub .hljs-identifier,
+.hljs-pi,
+.hljs-decorator,
+.tex .hljs-special,
+.haskell .hljs-type,
+.hljs-constant,
+.smalltalk .hljs-class,
+.hljs-javadoctag,
+.hljs-yardoctag,
+.hljs-phpdoc,
+.nginx .hljs-built_in {
   color: #FFFFB6;
 }
 
-pre .symbol,
-pre .ruby .symbol .string,
-pre .number,
-pre .variable,
-pre .vbscript,
-pre .literal {
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-number,
+.hljs-variable,
+.vbscript,
+.hljs-literal {
   color: #C6C5FE;
 }
 
-pre .css .tag {
+.css .hljs-tag {
   color: #96CBFE;
 }
 
-pre .css .rules .property,
-pre .css .id {
+.css .hljs-rules .hljs-property,
+.css .hljs-id {
   color: #FFFFB6;
 }
 
-pre .css .class {
+.css .hljs-class {
   color: #FFF;
 }
 
-pre .hexcolor {
+.hljs-hexcolor {
   color: #C6C5FE;
 }
 
-pre .number {
+.hljs-number {
   color:#FF73FD;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.7;
 }
diff --git a/src/styles/magula.css b/src/styles/magula.css
index f72d277..cafe3d3 100644
--- a/src/styles/magula.css
+++ b/src/styles/magula.css
@@ -7,115 +7,116 @@ Date: 2009-01-03
 Music: Aphex Twin / Xtal
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background-color: #f4f4f4;
 }
 
-pre code,
-pre .subst,
-pre .lisp .title,
-pre .clojure .built_in {
+.hljs,
+.hljs-subst,
+.lisp .hljs-title,
+.clojure .hljs-built_in {
   color: black;
 }
 
-pre .string,
-pre .title,
-pre .parent,
-pre .tag .value,
-pre .rules .value,
-pre .rules .value .number,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .aggregate,
-pre .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .addition,
-pre .flow,
-pre .stream,
-pre .bash .variable,
-pre .apache .cbracket,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-title,
+.hljs-parent,
+.hljs-tag .hljs-value,
+.hljs-rules .hljs-value,
+.hljs-rules .hljs-value .hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-aggregate,
+.hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-addition,
+.hljs-flow,
+.hljs-stream,
+.bash .hljs-variable,
+.apache .hljs-cbracket,
+.coffeescript .hljs-attribute {
   color: #050;
 }
 
-pre .comment,
-pre .annotation,
-pre .template_comment,
-pre .diff .header,
-pre .chunk {
+.hljs-comment,
+.hljs-annotation,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-chunk {
   color: #777;
 }
 
-pre .number,
-pre .date,
-pre .regexp,
-pre .literal,
-pre .smalltalk .symbol,
-pre .smalltalk .char,
-pre .change,
-pre .tex .special {
+.hljs-number,
+.hljs-date,
+.hljs-regexp,
+.hljs-literal,
+.smalltalk .hljs-symbol,
+.smalltalk .hljs-char,
+.hljs-change,
+.tex .hljs-special {
   color: #800;
 }
 
-pre .label,
-pre .javadoc,
-pre .ruby .string,
-pre .decorator,
-pre .filter .argument,
-pre .localvars,
-pre .array,
-pre .attr_selector,
-pre .pseudo,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .envvar,
-pre .shebang,
-pre .apache .sqbracket,
-pre .nginx .built_in,
-pre .tex .formula,
-pre .prompt,
-pre .clojure .attribute {
+.hljs-label,
+.hljs-javadoc,
+.ruby .hljs-string,
+.hljs-decorator,
+.hljs-filter .hljs-argument,
+.hljs-localvars,
+.hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-envvar,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in,
+.tex .hljs-formula,
+.hljs-prompt,
+.clojure .hljs-attribute {
   color: #00e;
 }
 
-pre .keyword,
-pre .id,
-pre .phpdoc,
-pre .title,
-pre .built_in,
-pre .aggregate,
-pre .smalltalk .class,
-pre .winutils,
-pre .bash .variable,
-pre .apache .tag,
-pre .xml .tag,
-pre .tex .command,
-pre .request,
-pre .status {
+.hljs-keyword,
+.hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.hljs-built_in,
+.hljs-aggregate,
+.smalltalk .hljs-class,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.xml .hljs-tag,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status {
   font-weight: bold;
   color: navy;
 }
 
-pre .nginx .built_in {
+.nginx .hljs-built_in {
   font-weight: normal;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
 
 /* --- */
-pre .apache .tag {
+.apache .hljs-tag {
   font-weight: bold;
   color: blue;
 }
diff --git a/src/styles/mono-blue.css b/src/styles/mono-blue.css
index 7c586eb..4152d82 100644
--- a/src/styles/mono-blue.css
+++ b/src/styles/mono-blue.css
@@ -1,59 +1,62 @@
 /*
   Five-color theme from a single blue hue.
 */
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #EAEEF3; color: #00193A;
 }
 
-pre .keyword,
-pre .title,
-pre .important,
-pre .request,
-pre .header,
-pre .javadoctag {
+.hljs-keyword,
+.hljs-title,
+.hljs-important,
+.hljs-request,
+.hljs-header,
+.hljs-javadoctag {
   font-weight: bold;
 }
 
-pre .comment,
-pre .chunk,
-pre .template_comment {
+.hljs-comment,
+.hljs-chunk,
+.hljs-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 {
+.hljs-string,
+.hljs-title,
+.hljs-parent,
+.hljs-built_in,
+.hljs-literal,
+.hljs-filename,
+.hljs-value,
+.hljs-addition,
+.hljs-tag,
+.hljs-argument,
+.hljs-link_label,
+.hljs-blockquote,
+.hljs-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 {
+.hljs-decorator,
+.hljs-prompt,
+.hljs-yardoctag,
+.hljs-subst,
+.hljs-symbol,
+.hljs-doctype,
+.hljs-regexp,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-pi,
+.hljs-attribute,
+.hljs-attr_selector,
+.hljs-javadoc,
+.hljs-xmlDocTag,
+.hljs-deletion,
+.hljs-shebang,
+.hljs-string .hljs-variable,
+.hljs-link_url,
+.hljs-bullet,
+.hljs-sqbracket,
+.hljs-phony {
   color: #4C81C9;
 }
diff --git a/src/styles/monokai.css b/src/styles/monokai.css
index c15fd4e..4e49bef 100644
--- a/src/styles/monokai.css
+++ b/src/styles/monokai.css
@@ -2,123 +2,126 @@
 Monokai style - ported by Luigi Maselli - http://grigio.org
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #272822;
 }
 
-pre .tag,
-pre .tag .title,
-pre .keyword,
-pre .literal,
-pre .strong,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tex .special {
+.hljs-tag,
+.hljs-tag .hljs-title,
+.hljs-keyword,
+.hljs-literal,
+.hljs-strong,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.tex .hljs-special {
   color: #F92672;
 }
 
-pre code {
+.hljs {
   color: #DDD;
 }
 
-pre code .constant {
+.hljs .hljs-constant,
+.asciidoc .hljs-code {
 	color: #66D9EF;
 }
 
-pre .code,
-pre .class .title,
-pre .header {
+.hljs-code,
+.hljs-class .hljs-title,
+.hljs-header {
 	color: white;
 }
 
-pre .link_label,
-pre .attribute,
-pre .symbol,
-pre .symbol .string,
-pre .value,
-pre .regexp {
+.hljs-link_label,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.hljs-value,
+.hljs-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,
-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 {
+.hljs-link_url,
+.hljs-tag .hljs-value,
+.hljs-string,
+.hljs-bullet,
+.hljs-subst,
+.hljs-title,
+.hljs-emphasis,
+.haskell .hljs-type,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.hljs-prompt {
   color: #A6E22E;
 }
 
-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 {
+.hljs-comment,
+.java .hljs-annotation,
+.smartquote,
+.hljs-blockquote,
+.hljs-horizontal_rule,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
   color: #75715E;
 }
 
-pre .keyword,
-pre .literal,
-pre .css .id,
-pre .phpdoc,
-pre .title,
-pre .header,
-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 {
+.hljs-keyword,
+.hljs-literal,
+.css .hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.hljs-header,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-special,
+.hljs-request,
+.hljs-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 {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/monokai_sublime.css b/src/styles/monokai_sublime.css
index d57e8ed..7b0eb2e 100644
--- a/src/styles/monokai_sublime.css
+++ b/src/styles/monokai_sublime.css
@@ -1,101 +1,149 @@
-/*
-
-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;
-}
+/*
+
+Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
+
+*/
+
+.hljs {
+  display: block;
+  padding: 0.5em;
+  background: #23241f;
+}
+
+.hljs,
+.hljs-tag,
+.css .hljs-rules,
+.css .hljs-value,
+.css .hljs-function
+.hljs-preprocessor,
+.hljs-pragma {
+  color: #f8f8f2;
+}
+
+.hljs-strongemphasis,
+.hljs-strong,
+.hljs-emphasis {
+  color: #a8a8a2;
+}
+
+.hljs-bullet,
+.hljs-blockquote,
+.hljs-horizontal_rule,
+.hljs-number,
+.hljs-regexp,
+.alias .hljs-keyword,
+.hljs-literal,
+.hljs-hexcolor {
+  color: #ae81ff;
+}
+
+.hljs-tag .hljs-value,
+.hljs-code,
+.hljs-title,
+.css .hljs-class,
+.hljs-class .hljs-title:last-child {
+  color: #a6e22e;
+}
+
+.hljs-link_url {
+  font-size: 80%;
+}
+
+.hljs-strong,
+.hljs-strongemphasis {
+  font-weight: bold;
+}
+
+.hljs-emphasis,
+.hljs-strongemphasis,
+.hljs-class .hljs-title:last-child {
+  font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-function,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.tex .hljs-special,
+.hljs-header,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.hljs-tag .hljs-title,
+.hljs-value,
+.alias .hljs-keyword:first-child,
+.css .hljs-tag,
+.css .unit,
+.css .hljs-important {
+  color: #F92672;
+}
+
+.hljs-function .hljs-keyword,
+.hljs-class .hljs-keyword:first-child,
+.hljs-constant,
+.css .hljs-attribute {
+  color: #66d9ef;
+}
+
+.hljs-variable,
+.hljs-params,
+.hljs-class .hljs-title {
+  color: #f8f8f2;
+}
+
+.hljs-string,
+.css .hljs-id,
+.hljs-subst,
+.haskell .hljs-type,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.hljs-prompt,
+.hljs-link_label,
+.hljs-link_url {
+  color: #e6db74;
+}
+
+.hljs-comment,
+.hljs-javadoc,
+.java .hljs-annotation,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
+  color: #75715e;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata,
+.xml .php,
+.php .xml {
+  opacity: 0.5;
+}
diff --git a/src/styles/obsidian.css b/src/styles/obsidian.css
index 7efb0b5..1174e4c 100644
--- a/src/styles/obsidian.css
+++ b/src/styles/obsidian.css
@@ -3,151 +3,152 @@
  * ported by Alexander Marenin (http://github.com/ioncreature)
  */
 
-pre code {
+.hljs {
     display: block; padding: 0.5em;
     background: #282B2E;
 }
 
-pre .keyword,
-pre .literal,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .css .id,
-pre .tex .special {
+.hljs-keyword,
+.hljs-literal,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.css .hljs-id,
+.tex .hljs-special {
     color: #93C763;
 }
 
-pre .number {
+.hljs-number {
     color: #FFCD22;
 }
 
-pre code {
+.hljs {
     color: #E0E2E4;
 }
 
-pre .css .tag,
-pre .css .pseudo {
+.css .hljs-tag,
+.css .hljs-pseudo {
     color: #D0D2B5;
 }
 
-pre .attribute,
-pre code .constant {
+.hljs-attribute,
+.hljs .hljs-constant {
     color: #668BB0;
 }
 
-pre .xml .attribute {
+.xml .hljs-attribute {
     color: #B3B689;
 }
 
-pre .xml .tag .value {
+.xml .hljs-tag .hljs-value {
     color: #E8E2B7;
 }
 
-pre .code,
-pre .class .title,
-pre .header {
+.hljs-code,
+.hljs-class .hljs-title,
+.hljs-header {
     color: white;
 }
 
-pre .class,
-pre .hexcolor {
+.hljs-class,
+.hljs-hexcolor {
     color: #93C763;
 }
 
-pre .regexp {
+.hljs-regexp {
     color: #D39745;
 }
 
-pre .at_rule,
-pre .at_rule .keyword {
+.hljs-at_rule,
+.hljs-at_rule .hljs-keyword {
     color: #A082BD;
 }
 
-pre .doctype {
+.hljs-doctype {
     color: #557182;
 }
 
-pre .link_url,
-pre .tag,
-pre .tag .title,
-pre .bullet,
-pre .subst,
-pre .emphasis,
-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 {
+.hljs-link_url,
+.hljs-tag,
+.hljs-tag .hljs-title,
+.hljs-bullet,
+.hljs-subst,
+.hljs-emphasis,
+.haskell .hljs-type,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.tex .hljs-command,
+.hljs-prompt {
     color: #8CBBAD;
 }
 
-pre .string {
+.hljs-string {
     color: #EC7600;
 }
 
-pre .comment,
-pre .java .annotation,
-pre .blockquote,
-pre .horizontal_rule,
-pre .python .decorator,
-pre .template_comment,
-pre .pi,
-pre .deletion,
-pre .shebang,
-pre .apache .sqbracket,
-pre .tex .formula {
+.hljs-comment,
+.java .hljs-annotation,
+.hljs-blockquote,
+.hljs-horizontal_rule,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket,
+.tex .hljs-formula {
     color: #818E96;
 }
 
-pre .keyword,
-pre .literal,
-pre .css .id,
-pre .phpdoc,
-pre .title,
-pre .header,
-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 .at_rule .keyword,
-pre .status {
+.hljs-keyword,
+.hljs-literal,
+.css .hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.hljs-header,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-special,
+.hljs-request,
+.hljs-at_rule .hljs-keyword,
+.hljs-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 {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
     opacity: 0.5;
 }
diff --git a/src/styles/paraiso.dark.css b/src/styles/paraiso.dark.css
new file mode 100644
index 0000000..bbbccdd
--- /dev/null
+++ b/src/styles/paraiso.dark.css
@@ -0,0 +1,93 @@
+/*
+    Paraíso (dark)
+    Created by Jan T. Sott (http://github.com/idleberg)
+    Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
+*/
+
+/* Paraíso Comment */
+.hljs-comment,
+.hljs-title {
+  color: #8d8687;
+}
+
+/* Paraíso Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #ef6155;
+}
+
+/* Paraíso Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #f99b15;
+}
+
+/* Paraíso Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #fec418;
+}
+
+/* Paraíso Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #48b685;
+}
+
+/* Paraíso Aqua */
+.css .hljs-hexcolor {
+  color: #5bc4bf;
+}
+
+/* Paraíso Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #06b6ef;
+}
+
+/* Paraíso Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #815ba4;
+}
+
+.hljs {
+  display: block;
+  background: #2f1e2e;
+  color: #a39e9b;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/paraiso.light.css b/src/styles/paraiso.light.css
new file mode 100644
index 0000000..494fcb4
--- /dev/null
+++ b/src/styles/paraiso.light.css
@@ -0,0 +1,93 @@
+/*
+    Paraíso (light)
+    Created by Jan T. Sott (http://github.com/idleberg)
+    Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
+*/
+
+/* Paraíso Comment */
+.hljs-comment,
+.hljs-title {
+  color: #776e71;
+}
+
+/* Paraíso Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
+  color: #ef6155;
+}
+
+/* Paraíso Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
+  color: #f99b15;
+}
+
+/* Paraíso Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
+  color: #fec418;
+}
+
+/* Paraíso Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
+  color: #48b685;
+}
+
+/* Paraíso Aqua */
+.css .hljs-hexcolor {
+  color: #5bc4bf;
+}
+
+/* Paraíso Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
+  color: #06b6ef;
+}
+
+/* Paraíso Purple */
+.hljs-keyword,
+.javascript .hljs-function {
+  color: #815ba4;
+}
+
+.hljs {
+  display: block;
+  background: #e7e9db;
+  color: #4f424c;
+  padding: 0.5em;
+}
+
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
+  opacity: 0.5;
+}
diff --git a/src/styles/pojoaque.css b/src/styles/pojoaque.css
index b9d20c2..6ee925d 100644
--- a/src/styles/pojoaque.css
+++ b/src/styles/pojoaque.css
@@ -6,99 +6,101 @@ Based on Solarized Style from http://ethanschoonover.com/solarized
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   color: #DCCF8F;
   background: url(./pojoaque.jpg) repeat scroll left top #181914;
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .doctype,
-pre .lisp .string,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-doctype,
+.lisp .hljs-string,
+.hljs-javadoc {
   color: #586e75;
   font-style: italic;
 }
 
-pre .keyword,
-pre .css .rule .keyword,
-pre .winutils,
-pre .javascript .title,
-pre .method,
-pre .addition,
-pre .css .tag,
-pre .clojure .title,
-pre .nginx .title {
+.hljs-keyword,
+.css .rule .hljs-keyword,
+.hljs-winutils,
+.javascript .hljs-title,
+.method,
+.hljs-addition,
+.css .hljs-tag,
+.clojure .hljs-title,
+.nginx .hljs-title {
   color: #B64926;
 }
 
-pre .number,
-pre .command,
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula,
-pre .regexp,
-pre .hexcolor {
+.hljs-number,
+.hljs-command,
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula,
+.hljs-regexp,
+.hljs-hexcolor {
   color: #468966;
 }
 
-pre .title,
-pre .localvars,
-pre .function .title,
-pre .chunk,
-pre .decorator,
-pre .built_in,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .identifier,
-pre .id {
+.hljs-title,
+.hljs-localvars,
+.hljs-function .hljs-title,
+.hljs-chunk,
+.hljs-decorator,
+.hljs-built_in,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.hljs-identifier,
+.hljs-id {
   color: #FFB03B;
 }
 
-pre .attribute,
-pre .variable,
-pre .lisp .body,
-pre .smalltalk .number,
-pre .constant,
-pre .class .title,
-pre .parent,
-pre .haskell .type {
+.hljs-attribute,
+.hljs-variable,
+.lisp .hljs-body,
+.smalltalk .hljs-number,
+.hljs-constant,
+.hljs-class .hljs-title,
+.hljs-parent,
+.haskell .hljs-type {
   color: #b58900;
 }
 
-pre .css .attribute {
+.css .hljs-attribute {
   color: #b89859;
 }
 
-pre .css .number,pre .css .hexcolor{
+.css .hljs-number,
+.css .hljs-hexcolor {
   color: #DCCF8F;
 }
 
-pre .css .class {
+.css .hljs-class {
   color: #d3a60c;
 }
 
-pre .preprocessor,
-pre .pi,
-pre .shebang,
-pre .symbol,
-pre .symbol .string,
-pre .diff .change,
-pre .special,
-pre .attr_selector,
-pre .important,
-pre .subst,
-pre .cdata {
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-pi,
+.hljs-shebang,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.diff .hljs-change,
+.hljs-special,
+.hljs-attr_selector,
+.hljs-important,
+.hljs-subst,
+.hljs-cdata {
   color: #cb4b16;
 }
 
-pre .deletion {
+.hljs-deletion {
   color: #dc322f;
 }
 
-pre .tex .formula {
+.tex .hljs-formula {
   background: #073642;
 }
diff --git a/src/styles/railscasts.css b/src/styles/railscasts.css
index bf55ea1..6a38064 100644
--- a/src/styles/railscasts.css
+++ b/src/styles/railscasts.css
@@ -4,178 +4,179 @@ Railscasts-like style (c) Visoft, Inc. (Damien White)
 
 */
 
-pre code {
+.hljs {
   display: block;
   padding: 0.5em;
   background: #232323;
   color: #E6E1DC;
 }
 
-pre .comment,
-pre .template_comment,
-pre .javadoc,
-pre .shebang {
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc,
+.hljs-shebang {
   color: #BC9458;
   font-style: italic;
 }
 
-pre .keyword,
-pre .ruby .function .keyword,
-pre .request,
-pre .status,
-pre .nginx .title,
-pre .method,
-pre .list .title {
+.hljs-keyword,
+.ruby .hljs-function .hljs-keyword,
+.hljs-request,
+.hljs-status,
+.nginx .hljs-title,
+.method,
+.hljs-list .hljs-title {
   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,
-pre .markdown .link_label {
+.hljs-string,
+.hljs-number,
+.hljs-regexp,
+.hljs-tag .hljs-value,
+.hljs-cdata,
+.hljs-filter .hljs-argument,
+.hljs-attr_selector,
+.apache .hljs-cbracket,
+.hljs-date,
+.tex .hljs-command,
+.markdown .hljs-link_label {
   color: #A5C261;
 }
 
-pre .subst {
+.hljs-subst {
   color: #519F50;
 }
 
-pre .tag,
-pre .tag .keyword,
-pre .tag .title,
-pre .doctype,
-pre .sub .identifier,
-pre .pi,
-pre .input_number {
+.hljs-tag,
+.hljs-tag .hljs-keyword,
+.hljs-tag .hljs-title,
+.hljs-doctype,
+.hljs-sub .hljs-identifier,
+.hljs-pi,
+.input_number {
   color: #E8BF6A;
 }
 
-pre .identifier {
+.hljs-identifier {
   color: #D0D0FF;
 }
 
-pre .class .title,
-pre .haskell .type,
-pre .smalltalk .class,
-pre .javadoctag,
-pre .yardoctag,
-pre .phpdoc {
+.hljs-class .hljs-title,
+.haskell .hljs-type,
+.smalltalk .hljs-class,
+.hljs-javadoctag,
+.hljs-yardoctag,
+.hljs-phpdoc {
   text-decoration: none;
 }
 
-pre .constant {
+.hljs-constant {
   color: #DA4939;
 }
 
 
-pre .symbol,
-pre .built_in,
-pre .ruby .symbol .string,
-pre .ruby .symbol .identifier,
-pre .markdown .link_url,
-pre .attribute {
+.hljs-symbol,
+.hljs-built_in,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-symbol .hljs-identifier,
+.markdown .hljs-link_url,
+.hljs-attribute {
   color: #6D9CBE;
 }
 
-pre .markdown .link_url {
+.markdown .hljs-link_url {
   text-decoration: underline;
 }
 
 
 
-pre .params,
-pre .variable,
-pre .clojure .attribute {
+.hljs-params,
+.hljs-variable,
+.clojure .hljs-attribute {
   color: #D0D0FF;
 }
 
-pre .css .tag,
-pre .rules .property,
-pre .pseudo,
-pre .tex .special {
+.css .hljs-tag,
+.hljs-rules .hljs-property,
+.hljs-pseudo,
+.tex .hljs-special {
   color: #CDA869;
 }
 
-pre .css .class {
+.css .hljs-class {
   color: #9B703F;
 }
 
-pre .rules .keyword {
+.hljs-rules .hljs-keyword {
   color: #C5AF75;
 }
 
-pre .rules .value {
+.hljs-rules .hljs-value {
   color: #CF6A4C;
 }
 
-pre .css .id {
+.css .hljs-id {
   color: #8B98AB;
 }
 
-pre .annotation,
-pre .apache .sqbracket,
-pre .nginx .built_in {
+.hljs-annotation,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in {
   color: #9B859D;
 }
 
-pre .preprocessor,
-pre .preprocessor *{
+.hljs-preprocessor,
+.hljs-preprocessor *,
+.hljs-pragma {
   color: #8996A8 !important;
 }
 
-pre .hexcolor,
-pre .css .value .number {
+.hljs-hexcolor,
+.css .hljs-value .hljs-number {
   color: #A5C261;
 }
 
-pre .title,
-pre .decorator,
-pre .css .function {
+.hljs-title,
+.hljs-decorator,
+.css .hljs-function {
   color: #FFC66D;
 }
 
-pre .diff .header,
-pre .chunk {
+.diff .hljs-header,
+.hljs-chunk {
   background-color: #2F33AB;
   color: #E6E1DC;
   display: inline-block;
   width: 100%;
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background-color: #4A410D;
   color: #F8F8F8;
   display: inline-block;
   width: 100%;
 }
 
-pre .addition {
+.hljs-addition {
   background-color: #144212;
   color: #E6E1DC;
   display: inline-block;
   width: 100%;
 }
 
-pre .deletion {
+.hljs-deletion {
   background-color: #600;
   color: #E6E1DC;
   display: inline-block;
   width: 100%;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.7;
 }
diff --git a/src/styles/rainbow.css b/src/styles/rainbow.css
index e8e098f..d9ffef6 100644
--- a/src/styles/rainbow.css
+++ b/src/styles/rainbow.css
@@ -4,111 +4,109 @@ Style with support for rainbow parens
 
 */
 
-pre ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
-pre ::selection { background:#FF5E99; color:#fff; text-shadow: none; }
-
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #474949; color: #D1D9E1;
 }
 
 
-pre .body,
-pre .collection {
+.hljs-body,
+.hljs-collection {
    color: #D1D9E1;
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .doctype,
-pre .lisp .string,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-doctype,
+.lisp .hljs-string,
+.hljs-javadoc {
   color: #969896;
   font-style: italic;
 }
 
-pre .keyword,
-pre .clojure .attribute,
-pre .winutils,
-pre .javascript .title,
-pre .addition,
-pre .css .tag {
+.hljs-keyword,
+.clojure .hljs-attribute,
+.hljs-winutils,
+.javascript .hljs-title,
+.hljs-addition,
+.css .hljs-tag {
   color: #cc99cc;
 }
 
-pre .number { color: #f99157; }
+.hljs-number { color: #f99157; }
 
-pre .command,
-pre .string,
-pre .tag .value,
-pre .phpdoc,
-pre .tex .formula,
-pre .regexp,
-pre .hexcolor {
+.hljs-command,
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula,
+.hljs-regexp,
+.hljs-hexcolor {
   color: #8abeb7;
 }
 
-pre .title,
-pre .localvars,
-pre .function .title,
-pre .chunk,
-pre .decorator,
-pre .built_in,
-pre .lisp .title,
-pre .identifier
+.hljs-title,
+.hljs-localvars,
+.hljs-function .hljs-title,
+.hljs-chunk,
+.hljs-decorator,
+.hljs-built_in,
+.lisp .hljs-title,
+.hljs-identifier
 {
   color: #b5bd68;
 }
 
-pre .class .keyword
+.hljs-class .hljs-keyword
 {
   color: #f2777a;
 }
 
-pre .variable,
-pre .lisp .body,
-pre .smalltalk .number,
-pre .constant,
-pre .class .title,
-pre .parent,
-pre .haskell .label,
-pre .id,
-pre .lisp .title,
-pre .clojure .title .built_in {
+.hljs-variable,
+.lisp .hljs-body,
+.smalltalk .hljs-number,
+.hljs-constant,
+.hljs-class .hljs-title,
+.hljs-parent,
+.haskell .hljs-label,
+.hljs-id,
+.lisp .hljs-title,
+.clojure .hljs-title .hljs-built_in {
    color: #ffcc66;
 }
 
-pre .tag .title,
-pre .rules .property,
-pre .django .tag .keyword,
-pre .clojure .title .built_in {
+.hljs-tag .hljs-title,
+.hljs-rules .hljs-property,
+.django .hljs-tag .hljs-keyword,
+.clojure .hljs-title .hljs-built_in {
   font-weight: bold;
 }
 
-pre .attribute,
-pre .clojure .title {
+.hljs-attribute,
+.clojure .hljs-title {
   color: #81a2be;
 }
 
-pre .preprocessor,
-pre .pi,
-pre .shebang,
-pre .symbol,
-pre .symbol .string,
-pre .diff .change,
-pre .special,
-pre .attr_selector,
-pre .important,
-pre .subst,
-pre .cdata {
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-pi,
+.hljs-shebang,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.diff .hljs-change,
+.hljs-special,
+.hljs-attr_selector,
+.hljs-important,
+.hljs-subst,
+.hljs-cdata {
   color: #f99157;
 }
 
-pre .deletion {
+.hljs-deletion {
   color: #dc322f;
 }
 
-pre .tex .formula {
+.tex .hljs-formula {
   background: #eee8d5;
 }
diff --git a/src/styles/school_book.css b/src/styles/school_book.css
index 3ee9e5f..98a3bd2 100644
--- a/src/styles/school_book.css
+++ b/src/styles/school_book.css
@@ -4,7 +4,7 @@ School Book style from goldblog.com.ua (c) Zaripov Yura <yur4ik7 at ukr.net>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 15px 0.5em 0.5em 30px;
   font-size: 11px !important;
   line-height:16px !important;
@@ -16,97 +16,98 @@ pre{
   border-bottom: solid 1px #d2e8b9;
 }
 
-pre .keyword,
-pre .literal,
-pre .change,
-pre .winutils,
-pre .flow,
-pre .lisp .title,
-pre .clojure .built_in,
-pre .nginx .title,
-pre .tex .special {
+.hljs-keyword,
+.hljs-literal,
+.hljs-change,
+.hljs-winutils,
+.hljs-flow,
+.lisp .hljs-title,
+.clojure .hljs-built_in,
+.nginx .hljs-title,
+.tex .hljs-special {
   color:#005599;
   font-weight:bold;
 }
 
-pre code,
-pre .subst,
-pre .tag .keyword {
+.hljs,
+.hljs-subst,
+.hljs-tag .hljs-keyword {
   color: #3E5915;
 }
 
-pre .string,
-pre .title,
-pre .haskell .type,
-pre .tag .value,
-pre .css .rules .value,
-pre .preprocessor,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .ruby .class .parent,
-pre .built_in,
-pre .sql .aggregate,
-pre .django .template_tag,
-pre .django .variable,
-pre .smalltalk .class,
-pre .javadoc,
-pre .ruby .string,
-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 .nginx .built_in,
-pre .tex .command,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-title,
+.haskell .hljs-type,
+.hljs-tag .hljs-value,
+.css .hljs-rules .hljs-value,
+.hljs-preprocessor,
+.hljs-pragma,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-class .hljs-parent,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.django .hljs-template_tag,
+.django .hljs-variable,
+.smalltalk .hljs-class,
+.hljs-javadoc,
+.ruby .hljs-string,
+.django .hljs-filter .hljs-argument,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-addition,
+.hljs-stream,
+.hljs-envvar,
+.apache .hljs-tag,
+.apache .hljs-cbracket,
+.nginx .hljs-built_in,
+.tex .hljs-command,
+.coffeescript .hljs-attribute {
   color: #2C009F;
 }
 
-pre .comment,
-pre .java .annotation,
-pre .python .decorator,
-pre .template_comment,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .shebang,
-pre .apache .sqbracket {
+.hljs-comment,
+.java .hljs-annotation,
+.python .hljs-decorator,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-shebang,
+.apache .hljs-sqbracket {
   color: #E60415;
 }
 
-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 .xml .tag .title,
-pre .diff .header,
-pre .chunk,
-pre .winutils,
-pre .bash .variable,
-pre .apache .tag,
-pre .tex .command,
-pre .request,
-pre .status {
+.hljs-keyword,
+.hljs-literal,
+.css .hljs-id,
+.hljs-phpdoc,
+.hljs-title,
+.haskell .hljs-type,
+.vbscript .hljs-built_in,
+.sql .hljs-aggregate,
+.rsl .hljs-built_in,
+.smalltalk .hljs-class,
+.xml .hljs-tag .hljs-title,
+.diff .hljs-header,
+.hljs-chunk,
+.hljs-winutils,
+.bash .hljs-variable,
+.apache .hljs-tag,
+.tex .hljs-command,
+.hljs-request,
+.hljs-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 {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/solarized_dark.css b/src/styles/solarized_dark.css
index afefba7..f520533 100644
--- a/src/styles/solarized_dark.css
+++ b/src/styles/solarized_dark.css
@@ -4,88 +4,104 @@ Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums at gmai
 
 */
 
-pre code {
-  display: block; padding: 0.5em;
-  background: #002b36; color: #839496;
+.hljs {
+  display: block;
+  padding: 0.5em;
+  background: #002b36;
+  color: #839496;
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .doctype,
-pre .pi,
-pre .lisp .string,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-doctype,
+.hljs-pi,
+.lisp .hljs-string,
+.hljs-javadoc {
   color: #586e75;
-  font-style: italic;
 }
 
-pre .keyword,
-pre .winutils,
-pre .method,
-pre .addition,
-pre .css .tag,
-pre .request,
-pre .status,
-pre .nginx .title {
+/* Solarized Green */
+.hljs-keyword,
+.hljs-winutils,
+.method,
+.hljs-addition,
+.css .hljs-tag,
+.hljs-request,
+.hljs-status,
+.nginx .hljs-title {
   color: #859900;
 }
 
-pre .number,
-pre .command,
-pre .string,
-pre .tag .value,
-pre .rules .value,
-pre .phpdoc,
-pre .tex .formula,
-pre .regexp,
-pre .hexcolor {
+/* Solarized Cyan */
+.hljs-number,
+.hljs-command,
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-rules .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula,
+.hljs-regexp,
+.hljs-hexcolor,
+.hljs-link_url {
   color: #2aa198;
 }
 
-pre .title,
-pre .localvars,
-pre .chunk,
-pre .decorator,
-pre .built_in,
-pre .identifier,
-pre .vhdl .literal,
-pre .id,
-pre .css .function {
+/* Solarized Blue */
+.hljs-title,
+.hljs-localvars,
+.hljs-chunk,
+.hljs-decorator,
+.hljs-built_in,
+.hljs-identifier,
+.vhdl .hljs-literal,
+.hljs-id,
+.css .hljs-function {
   color: #268bd2;
 }
 
-pre .attribute,
-pre .variable,
-pre .lisp .body,
-pre .smalltalk .number,
-pre .constant,
-pre .class .title,
-pre .parent,
-pre .haskell .type {
+/* Solarized Yellow */
+.hljs-attribute,
+.hljs-variable,
+.lisp .hljs-body,
+.smalltalk .hljs-number,
+.hljs-constant,
+.hljs-class .hljs-title,
+.hljs-parent,
+.haskell .hljs-type,
+.hljs-link_reference {
   color: #b58900;
 }
 
-pre .preprocessor,
-pre .preprocessor .keyword,
-pre .shebang,
-pre .symbol,
-pre .symbol .string,
-pre .diff .change,
-pre .special,
-pre .attr_selector,
-pre .important,
-pre .subst,
-pre .cdata,
-pre .clojure .title,
-pre .css .pseudo {
+/* Solarized Orange */
+.hljs-preprocessor,
+.hljs-preprocessor .hljs-keyword,
+.hljs-pragma,
+.hljs-shebang,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.diff .hljs-change,
+.hljs-special,
+.hljs-attr_selector,
+.hljs-subst,
+.hljs-cdata,
+.clojure .hljs-title,
+.css .hljs-pseudo,
+.hljs-header {
   color: #cb4b16;
 }
 
-pre .deletion {
+/* Solarized Red */
+.hljs-deletion,
+.hljs-important {
   color: #dc322f;
 }
 
-pre .tex .formula {
+/* Solarized Violet */
+.hljs-link_label {
+  color: #6c71c4;
+}
+
+.tex .hljs-formula {
   background: #073642;
 }
diff --git a/src/styles/solarized_light.css b/src/styles/solarized_light.css
index dd042a4..ad70474 100644
--- a/src/styles/solarized_light.css
+++ b/src/styles/solarized_light.css
@@ -4,88 +4,104 @@ Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums at gmai
 
 */
 
-pre code {
-  display: block; padding: 0.5em;
-  background: #fdf6e3; color: #657b83;
+.hljs {
+  display: block;
+  padding: 0.5em;
+  background: #fdf6e3;
+  color: #657b83;
 }
 
-pre .comment,
-pre .template_comment,
-pre .diff .header,
-pre .doctype,
-pre .pi,
-pre .lisp .string,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-doctype,
+.hljs-pi,
+.lisp .hljs-string,
+.hljs-javadoc {
   color: #93a1a1;
-  font-style: italic;
 }
 
-pre .keyword,
-pre .winutils,
-pre .method,
-pre .addition,
-pre .css .tag,
-pre .request,
-pre .status,
-pre .nginx .title {
+/* Solarized Green */
+.hljs-keyword,
+.hljs-winutils,
+.method,
+.hljs-addition,
+.css .hljs-tag,
+.hljs-request,
+.hljs-status,
+.nginx .hljs-title {
   color: #859900;
 }
 
-pre .number,
-pre .command,
-pre .string,
-pre .tag .value,
-pre .rules .value,
-pre .phpdoc,
-pre .tex .formula,
-pre .regexp,
-pre .hexcolor {
+/* Solarized Cyan */
+.hljs-number,
+.hljs-command,
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-rules .hljs-value,
+.hljs-phpdoc,
+.tex .hljs-formula,
+.hljs-regexp,
+.hljs-hexcolor,
+.hljs-link_url {
   color: #2aa198;
 }
 
-pre .title,
-pre .localvars,
-pre .chunk,
-pre .decorator,
-pre .built_in,
-pre .identifier,
-pre .vhdl .literal,
-pre .id,
-pre .css .function {
+/* Solarized Blue */
+.hljs-title,
+.hljs-localvars,
+.hljs-chunk,
+.hljs-decorator,
+.hljs-built_in,
+.hljs-identifier,
+.vhdl .hljs-literal,
+.hljs-id,
+.css .hljs-function {
   color: #268bd2;
 }
 
-pre .attribute,
-pre .variable,
-pre .lisp .body,
-pre .smalltalk .number,
-pre .constant,
-pre .class .title,
-pre .parent,
-pre .haskell .type {
+/* Solarized Yellow */
+.hljs-attribute,
+.hljs-variable,
+.lisp .hljs-body,
+.smalltalk .hljs-number,
+.hljs-constant,
+.hljs-class .hljs-title,
+.hljs-parent,
+.haskell .hljs-type,
+.hljs-link_reference {
   color: #b58900;
 }
 
-pre .preprocessor,
-pre .preprocessor .keyword,
-pre .shebang,
-pre .symbol,
-pre .symbol .string,
-pre .diff .change,
-pre .special,
-pre .attr_selector,
-pre .important,
-pre .subst,
-pre .cdata,
-pre .clojure .title,
-pre .css .pseudo {
+/* Solarized Orange */
+.hljs-preprocessor,
+.hljs-preprocessor .hljs-keyword,
+.hljs-pragma,
+.hljs-shebang,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.diff .hljs-change,
+.hljs-special,
+.hljs-attr_selector,
+.hljs-subst,
+.hljs-cdata,
+.clojure .hljs-title,
+.css .hljs-pseudo,
+.hljs-header {
   color: #cb4b16;
 }
 
-pre .deletion {
+/* Solarized Red */
+.hljs-deletion,
+.hljs-important {
   color: #dc322f;
 }
 
-pre .tex .formula {
+/* Solarized Violet */
+.hljs-link_label {
+  color: #6c71c4;
+}
+
+.tex .hljs-formula {
   background: #eee8d5;
 }
diff --git a/src/styles/sunburst.css b/src/styles/sunburst.css
index c5d6e1a..07b30c2 100644
--- a/src/styles/sunburst.css
+++ b/src/styles/sunburst.css
@@ -4,156 +4,157 @@ Sunburst-like style (c) Vasily Polovnyov <vast at whiteants.net>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #000; color: #f8f8f8;
 }
 
-pre .comment,
-pre .template_comment,
-pre .javadoc {
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc {
   color: #aeaeae;
   font-style: italic;
 }
 
-pre .keyword,
-pre .ruby .function .keyword,
-pre .request,
-pre .status,
-pre .nginx .title {
+.hljs-keyword,
+.ruby .hljs-function .hljs-keyword,
+.hljs-request,
+.hljs-status,
+.nginx .hljs-title {
   color: #E28964;
 }
 
-pre .function .keyword,
-pre .sub .keyword,
-pre .method,
-pre .list .title {
+.hljs-function .hljs-keyword,
+.hljs-sub .hljs-keyword,
+.method,
+.hljs-list .hljs-title {
   color: #99CF50;
 }
 
-pre .string,
-pre .tag .value,
-pre .cdata,
-pre .filter .argument,
-pre .attr_selector,
-pre .apache .cbracket,
-pre .date,
-pre .tex .command,
-pre .coffeescript .attribute {
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-cdata,
+.hljs-filter .hljs-argument,
+.hljs-attr_selector,
+.apache .hljs-cbracket,
+.hljs-date,
+.tex .hljs-command,
+.coffeescript .hljs-attribute {
   color: #65B042;
 }
 
-pre .subst {
+.hljs-subst {
   color: #DAEFA3;
 }
 
-pre .regexp {
+.hljs-regexp {
   color: #E9C062;
 }
 
-pre .title,
-pre .sub .identifier,
-pre .pi,
-pre .tag,
-pre .tag .keyword,
-pre .decorator,
-pre .shebang,
-pre .prompt {
+.hljs-title,
+.hljs-sub .hljs-identifier,
+.hljs-pi,
+.hljs-tag,
+.hljs-tag .hljs-keyword,
+.hljs-decorator,
+.hljs-shebang,
+.hljs-prompt {
   color: #89BDFF;
 }
 
-pre .class .title,
-pre .haskell .type,
-pre .smalltalk .class,
-pre .javadoctag,
-pre .yardoctag,
-pre .phpdoc {
+.hljs-class .hljs-title,
+.haskell .hljs-type,
+.smalltalk .hljs-class,
+.hljs-javadoctag,
+.hljs-yardoctag,
+.hljs-phpdoc {
   text-decoration: underline;
 }
 
-pre .symbol,
-pre .ruby .symbol .string,
-pre .number {
+.hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-number {
   color: #3387CC;
 }
 
-pre .params,
-pre .variable,
-pre .clojure .attribute {
+.hljs-params,
+.hljs-variable,
+.clojure .hljs-attribute {
   color: #3E87E3;
 }
 
-pre .css .tag,
-pre .rules .property,
-pre .pseudo,
-pre .tex .special {
+.css .hljs-tag,
+.hljs-rules .hljs-property,
+.hljs-pseudo,
+.tex .hljs-special {
   color: #CDA869;
 }
 
-pre .css .class {
+.css .hljs-class {
   color: #9B703F;
 }
 
-pre .rules .keyword {
+.hljs-rules .hljs-keyword {
   color: #C5AF75;
 }
 
-pre .rules .value {
+.hljs-rules .hljs-value {
   color: #CF6A4C;
 }
 
-pre .css .id {
+.css .hljs-id {
   color: #8B98AB;
 }
 
-pre .annotation,
-pre .apache .sqbracket,
-pre .nginx .built_in {
+.hljs-annotation,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in {
   color: #9B859D;
 }
 
-pre .preprocessor {
+.hljs-preprocessor,
+.hljs-pragma {
   color: #8996A8;
 }
 
-pre .hexcolor,
-pre .css .value .number {
+.hljs-hexcolor,
+.css .hljs-value .hljs-number {
   color: #DD7B3B;
 }
 
-pre .css .function {
+.css .hljs-function {
   color: #DAD085;
 }
 
-pre .diff .header,
-pre .chunk,
-pre .tex .formula {
+.diff .hljs-header,
+.hljs-chunk,
+.tex .hljs-formula {
   background-color: #0E2231;
   color: #F8F8F8;
   font-style: italic;
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background-color: #4A410D;
   color: #F8F8F8;
 }
 
-pre .addition {
+.hljs-addition {
   background-color: #253B22;
   color: #F8F8F8;
 }
 
-pre .deletion {
+.hljs-deletion {
   background-color: #420E09;
   color: #F8F8F8;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/tomorrow-night-blue.css b/src/styles/tomorrow-night-blue.css
index aac64a1..dfe2675 100644
--- a/src/styles/tomorrow-night-blue.css
+++ b/src/styles/tomorrow-night-blue.css
@@ -2,51 +2,92 @@
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
 /* Original theme - https://github.com/chriskempson/tomorrow-theme */
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
-.tomorrow-comment, pre .comment, pre .title {
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-title {
   color: #7285b7;
 }
 
-.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
   color: #ff9da4;
 }
 
-.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
   color: #ffc58f;
 }
 
-.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
+/* Tomorrow Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
   color: #ffeead;
 }
 
-.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
+/* Tomorrow Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
   color: #d1f1a9;
 }
 
-.tomorrow-aqua, pre .css .hexcolor {
+/* Tomorrow Aqua */
+.css .hljs-hexcolor {
   color: #99ffff;
 }
 
-.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
+/* Tomorrow Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
   color: #bbdaff;
 }
 
-.tomorrow-purple, pre .keyword, pre .javascript .function {
+/* Tomorrow Purple */
+.hljs-keyword,
+.javascript .hljs-function {
   color: #ebbbff;
 }
 
-pre code {
+.hljs {
   display: block;
   background: #002451;
   color: white;
   padding: 0.5em;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/tomorrow-night-bright.css b/src/styles/tomorrow-night-bright.css
index 5f32b04..4ad5d25 100644
--- a/src/styles/tomorrow-night-bright.css
+++ b/src/styles/tomorrow-night-bright.css
@@ -1,51 +1,92 @@
 /* Tomorrow Night Bright Theme */
 /* Original theme - https://github.com/chriskempson/tomorrow-theme */
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
-.tomorrow-comment, pre .comment, pre .title {
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-title {
   color: #969896;
 }
 
-.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
   color: #d54e53;
 }
 
-.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
   color: #e78c45;
 }
 
-.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
+/* Tomorrow Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
   color: #e7c547;
 }
 
-.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
+/* Tomorrow Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
   color: #b9ca4a;
 }
 
-.tomorrow-aqua, pre .css .hexcolor {
+/* Tomorrow Aqua */
+.css .hljs-hexcolor {
   color: #70c0b1;
 }
 
-.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
+/* Tomorrow Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
   color: #7aa6da;
 }
 
-.tomorrow-purple, pre .keyword, pre .javascript .function {
+/* Tomorrow Purple */
+.hljs-keyword,
+.javascript .hljs-function {
   color: #c397d8;
 }
 
-pre code {
+.hljs {
   display: block;
   background: black;
   color: #eaeaea;
   padding: 0.5em;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/tomorrow-night-eighties.css b/src/styles/tomorrow-night-eighties.css
index 8081687..08b49c6 100644
--- a/src/styles/tomorrow-night-eighties.css
+++ b/src/styles/tomorrow-night-eighties.css
@@ -1,51 +1,92 @@
 /* Tomorrow Night Eighties Theme */
 /* Original theme - https://github.com/chriskempson/tomorrow-theme */
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
-.tomorrow-comment, pre .comment, pre .title {
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-title {
   color: #999999;
 }
 
-.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
   color: #f2777a;
 }
 
-.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
   color: #f99157;
 }
 
-.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
+/* Tomorrow Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
   color: #ffcc66;
 }
 
-.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
+/* Tomorrow Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
   color: #99cc99;
 }
 
-.tomorrow-aqua, pre .css .hexcolor {
+/* Tomorrow Aqua */
+.css .hljs-hexcolor {
   color: #66cccc;
 }
 
-.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
+/* Tomorrow Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
   color: #6699cc;
 }
 
-.tomorrow-purple, pre .keyword, pre .javascript .function {
+/* Tomorrow Purple */
+.hljs-keyword,
+.javascript .hljs-function {
   color: #cc99cc;
 }
 
-pre code {
+.hljs {
   display: block;
   background: #2d2d2d;
   color: #cccccc;
   padding: 0.5em;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/tomorrow-night.css b/src/styles/tomorrow-night.css
index ad2aee5..c269b17 100644
--- a/src/styles/tomorrow-night.css
+++ b/src/styles/tomorrow-night.css
@@ -2,51 +2,92 @@
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
 /* Original theme - https://github.com/chriskempson/tomorrow-theme */
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
-.tomorrow-comment, pre .comment, pre .title {
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-title {
   color: #969896;
 }
 
-.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
   color: #cc6666;
 }
 
-.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
   color: #de935f;
 }
 
-.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
+/* Tomorrow Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
   color: #f0c674;
 }
 
-.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
+/* Tomorrow Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
   color: #b5bd68;
 }
 
-.tomorrow-aqua, pre .css .hexcolor {
+/* Tomorrow Aqua */
+.css .hljs-hexcolor {
   color: #8abeb7;
 }
 
-.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
+/* Tomorrow Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
   color: #81a2be;
 }
 
-.tomorrow-purple, pre .keyword, pre .javascript .function {
+/* Tomorrow Purple */
+.hljs-keyword,
+.javascript .hljs-function {
   color: #b294bb;
 }
 
-pre code {
+.hljs {
   display: block;
   background: #1d1f21;
   color: #c5c8c6;
   padding: 0.5em;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/tomorrow.css b/src/styles/tomorrow.css
index 9f5c1d6..3bdead6 100644
--- a/src/styles/tomorrow.css
+++ b/src/styles/tomorrow.css
@@ -1,49 +1,90 @@
 /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
-.tomorrow-comment, pre .comment, pre .title {
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-title {
   color: #8e908c;
 }
 
-.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-regexp,
+.ruby .hljs-constant,
+.xml .hljs-tag .hljs-title,
+.xml .hljs-pi,
+.xml .hljs-doctype,
+.html .hljs-doctype,
+.css .hljs-id,
+.css .hljs-class,
+.css .hljs-pseudo {
   color: #c82829;
 }
 
-.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.hljs-literal,
+.hljs-params,
+.hljs-constant {
   color: #f5871f;
 }
 
-.tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute {
+/* Tomorrow Yellow */
+.ruby .hljs-class .hljs-title,
+.css .hljs-rules .hljs-attribute {
   color: #eab700;
 }
 
-.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
+/* Tomorrow Green */
+.hljs-string,
+.hljs-value,
+.hljs-inheritance,
+.hljs-header,
+.ruby .hljs-symbol,
+.xml .hljs-cdata {
   color: #718c00;
 }
 
-.tomorrow-aqua, pre .css .hexcolor {
+/* Tomorrow Aqua */
+.css .hljs-hexcolor {
   color: #3e999f;
 }
 
-.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
+/* Tomorrow Blue */
+.hljs-function,
+.python .hljs-decorator,
+.python .hljs-title,
+.ruby .hljs-function .hljs-title,
+.ruby .hljs-title .hljs-keyword,
+.perl .hljs-sub,
+.javascript .hljs-title,
+.coffeescript .hljs-title {
   color: #4271ae;
 }
 
-.tomorrow-purple, pre .keyword, pre .javascript .function {
+/* Tomorrow Purple */
+.hljs-keyword,
+.javascript .hljs-function {
   color: #8959a8;
 }
 
-pre code {
+.hljs {
   display: block;
   background: white;
   color: #4d4d4c;
   padding: 0.5em;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
diff --git a/src/styles/vs.css b/src/styles/vs.css
index 6760269..bf33f0f 100644
--- a/src/styles/vs.css
+++ b/src/styles/vs.css
@@ -3,86 +3,87 @@
 Visual Studio-like style based on original C# coloring by Jason Diamond <jason at diamond.name>
 
 */
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: white; color: black;
 }
 
-pre .comment,
-pre .annotation,
-pre .template_comment,
-pre .diff .header,
-pre .chunk,
-pre .apache .cbracket {
-  color: rgb(0, 128, 0);
+.hljs-comment,
+.hljs-annotation,
+.hljs-template_comment,
+.diff .hljs-header,
+.hljs-chunk,
+.apache .hljs-cbracket {
+  color: #008000;
 }
 
-pre .keyword,
-pre .id,
-pre .built_in,
-pre .smalltalk .class,
-pre .winutils,
-pre .bash .variable,
-pre .tex .command,
-pre .request,
-pre .status,
-pre .nginx .title,
-pre .xml .tag,
-pre .xml .tag .value {
-  color: rgb(0, 0, 255);
+.hljs-keyword,
+.hljs-id,
+.hljs-built_in,
+.smalltalk .hljs-class,
+.hljs-winutils,
+.bash .hljs-variable,
+.tex .hljs-command,
+.hljs-request,
+.hljs-status,
+.nginx .hljs-title,
+.xml .hljs-tag,
+.xml .hljs-tag .hljs-value {
+  color: #00f;
 }
 
-pre .string,
-pre .title,
-pre .parent,
-pre .tag .value,
-pre .rules .value,
-pre .rules .value .number,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .aggregate,
-pre .template_tag,
-pre .django .variable,
-pre .addition,
-pre .flow,
-pre .stream,
-pre .apache .tag,
-pre .date,
-pre .tex .formula,
-pre .coffeescript .attribute {
-  color: rgb(163, 21, 21);
+.hljs-string,
+.hljs-title,
+.hljs-parent,
+.hljs-tag .hljs-value,
+.hljs-rules .hljs-value,
+.hljs-rules .hljs-value .hljs-number,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.hljs-aggregate,
+.hljs-template_tag,
+.django .hljs-variable,
+.hljs-addition,
+.hljs-flow,
+.hljs-stream,
+.apache .hljs-tag,
+.hljs-date,
+.tex .hljs-formula,
+.coffeescript .hljs-attribute {
+  color: #a31515;
 }
 
-pre .ruby .string,
-pre .decorator,
-pre .filter .argument,
-pre .localvars,
-pre .array,
-pre .attr_selector,
-pre .pseudo,
-pre .pi,
-pre .doctype,
-pre .deletion,
-pre .envvar,
-pre .shebang,
-pre .preprocessor,
-pre .userType,
-pre .apache .sqbracket,
-pre .nginx .built_in,
-pre .tex .special,
-pre .prompt {
-  color: rgb(43, 145, 175);
+.ruby .hljs-string,
+.hljs-decorator,
+.hljs-filter .hljs-argument,
+.hljs-localvars,
+.hljs-array,
+.hljs-attr_selector,
+.hljs-pseudo,
+.hljs-pi,
+.hljs-doctype,
+.hljs-deletion,
+.hljs-envvar,
+.hljs-shebang,
+.hljs-preprocessor,
+.hljs-pragma,
+.userType,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in,
+.tex .hljs-special,
+.hljs-prompt {
+  color: #2b91af;
 }
 
-pre .phpdoc,
-pre .javadoc,
-pre .xmlDocTag {
-  color: rgb(128, 128, 128);
+.hljs-phpdoc,
+.hljs-javadoc,
+.hljs-xmlDocTag {
+  color: #808080;
 }
 
-pre .vhdl .typename { font-weight: bold; }
-pre .vhdl .string { color: #666666; }
-pre .vhdl .literal { color: rgb(163, 21, 21); }
-pre .vhdl .attribute { color: #00B0E8; }
+.vhdl .hljs-typename { font-weight: bold; }
+.vhdl .hljs-string { color: #666666; }
+.vhdl .hljs-literal { color: #a31515; }
+.vhdl .hljs-attribute { color: #00B0E8; }
 
-pre .xml .attribute { color: rgb(255, 0, 0); }
+.xml .hljs-attribute { color: #f00; }
diff --git a/src/styles/xcode.css b/src/styles/xcode.css
index 881ce2f..57bd748 100644
--- a/src/styles/xcode.css
+++ b/src/styles/xcode.css
@@ -4,153 +4,155 @@ XCode style (c) Angel Garcia <angelgarcia.mail at gmail.com>
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #fff; color: black;
 }
 
-pre .comment,
-pre .template_comment,
-pre .javadoc,
-pre .comment * {
-  color: rgb(0,106,0);
+.hljs-comment,
+.hljs-template_comment,
+.hljs-javadoc,
+.hljs-comment * {
+  color: #006a00;
 }
 
-pre .keyword,
-pre .literal,
-pre .nginx .title {
-  color: rgb(170,13,145);
+.hljs-keyword,
+.hljs-literal,
+.nginx .hljs-title {
+  color: #aa0d91;
 }
-pre .method,
-pre .list .title,
-pre .tag .title,
-pre .setting .value,
-pre .winutils,
-pre .tex .command,
-pre .http .title,
-pre .request,
-pre .status {
+.method,
+.hljs-list .hljs-title,
+.hljs-tag .hljs-title,
+.setting .hljs-value,
+.hljs-winutils,
+.tex .hljs-command,
+.http .hljs-title,
+.hljs-request,
+.hljs-status {
   color: #008;
 }
 
-pre .envvar,
-pre .tex .special {
+.hljs-envvar,
+.tex .hljs-special {
   color: #660;
 }
 
-pre .string {
-  color: rgb(196,26,22);
+.hljs-string {
+  color: #c41a16;
 }
-pre .tag .value,
-pre .cdata,
-pre .filter .argument,
-pre .attr_selector,
-pre .apache .cbracket,
-pre .date,
-pre .regexp {
+.hljs-tag .hljs-value,
+.hljs-cdata,
+.hljs-filter .hljs-argument,
+.hljs-attr_selector,
+.apache .hljs-cbracket,
+.hljs-date,
+.hljs-regexp {
   color: #080;
 }
 
-pre .sub .identifier,
-pre .pi,
-pre .tag,
-pre .tag .keyword,
-pre .decorator,
-pre .ini .title,
-pre .shebang,
-pre .prompt,
-pre .hexcolor,
-pre .rules .value,
-pre .css .value .number,
-pre .symbol,
-pre .symbol .string,
-pre .number,
-pre .css .function,
-pre .clojure .title,
-pre .clojure .built_in,
-pre .function .title,
-pre .coffeescript .attribute {
-  color: rgb(28,0,207);
-}
-
-pre .class .title,
-pre .haskell .type,
-pre .smalltalk .class,
-pre .javadoctag,
-pre .yardoctag,
-pre .phpdoc,
-pre .typename,
-pre .tag .attribute,
-pre .doctype,
-pre .class .id,
-pre .built_in,
-pre .setting,
-pre .params,
-pre .clojure .attribute {
-  color: rgb(92,38,153);
-}
-
-pre .variable {
- color: rgb(63,110,116);
-}
-pre .css .tag,
-pre .rules .property,
-pre .pseudo,
-pre .subst {
+.hljs-sub .hljs-identifier,
+.hljs-pi,
+.hljs-tag,
+.hljs-tag .hljs-keyword,
+.hljs-decorator,
+.ini .hljs-title,
+.hljs-shebang,
+.hljs-prompt,
+.hljs-hexcolor,
+.hljs-rules .hljs-value,
+.css .hljs-value .hljs-number,
+.hljs-symbol,
+.hljs-symbol .hljs-string,
+.hljs-number,
+.css .hljs-function,
+.clojure .hljs-title,
+.clojure .hljs-built_in,
+.hljs-function .hljs-title,
+.coffeescript .hljs-attribute {
+  color: #1c00cf;
+}
+
+.hljs-class .hljs-title,
+.haskell .hljs-type,
+.smalltalk .hljs-class,
+.hljs-javadoctag,
+.hljs-yardoctag,
+.hljs-phpdoc,
+.hljs-typename,
+.hljs-tag .hljs-attribute,
+.hljs-doctype,
+.hljs-class .hljs-id,
+.hljs-built_in,
+.setting,
+.hljs-params,
+.clojure .hljs-attribute {
+  color: #5c2699;
+}
+
+.hljs-variable {
+ color: #3f6e74;
+}
+.css .hljs-tag,
+.hljs-rules .hljs-property,
+.hljs-pseudo,
+.hljs-subst {
   color: #000;
 }
 
-pre .css .class, pre .css .id {
+.css .hljs-class,
+.css .hljs-id {
   color: #9B703F;
 }
 
-pre .value .important {
+.hljs-value .hljs-important {
   color: #ff7700;
   font-weight: bold;
 }
 
-pre .rules .keyword {
+.hljs-rules .hljs-keyword {
   color: #C5AF75;
 }
 
-pre .annotation,
-pre .apache .sqbracket,
-pre .nginx .built_in {
+.hljs-annotation,
+.apache .hljs-sqbracket,
+.nginx .hljs-built_in {
   color: #9B859D;
 }
 
-pre .preprocessor,
-pre .preprocessor * {
-  color: rgb(100,56,32);
+.hljs-preprocessor,
+.hljs-preprocessor *,
+.hljs-pragma {
+  color: #643820;
 }
 
-pre .tex .formula {
+.tex .hljs-formula {
   background-color: #EEE;
   font-style: italic;
 }
 
-pre .diff .header,
-pre .chunk {
+.diff .hljs-header,
+.hljs-chunk {
   color: #808080;
   font-weight: bold;
 }
 
-pre .diff .change {
+.diff .hljs-change {
   background-color: #BCCFF9;
 }
 
-pre .addition {
+.hljs-addition {
   background-color: #BAEEBA;
 }
 
-pre .deletion {
+.hljs-deletion {
   background-color: #FFC8BD;
 }
 
-pre .comment .yardoctag {
+.hljs-comment .hljs-yardoctag {
   font-weight: bold;
 }
 
-pre .method .id {
+.method .hljs-id {
   color: #000;
 }
diff --git a/src/styles/zenburn.css b/src/styles/zenburn.css
index bc80c43..f6cb098 100644
--- a/src/styles/zenburn.css
+++ b/src/styles/zenburn.css
@@ -5,112 +5,113 @@ based on dark.css by Ivan Sagalaev
 
 */
 
-pre code {
+.hljs {
   display: block; padding: 0.5em;
   background: #3F3F3F;
   color: #DCDCDC;
 }
 
-pre .keyword,
-pre .tag,
-pre .css .class,
-pre .css .id,
-pre .lisp .title,
-pre .nginx .title,
-pre .request,
-pre .status,
-pre .clojure .attribute {
+.hljs-keyword,
+.hljs-tag,
+.css .hljs-class,
+.css .hljs-id,
+.lisp .hljs-title,
+.nginx .hljs-title,
+.hljs-request,
+.hljs-status,
+.clojure .hljs-attribute {
   color: #E3CEAB;
 }
 
-pre .django .template_tag,
-pre .django .variable,
-pre .django .filter .argument {
+.django .hljs-template_tag,
+.django .hljs-variable,
+.django .hljs-filter .hljs-argument {
   color: #DCDCDC;
 }
 
-pre .number,
-pre .date {
+.hljs-number,
+.hljs-date {
   color: #8CD0D3;
 }
 
-pre .dos .envvar,
-pre .dos .stream,
-pre .variable,
-pre .apache .sqbracket {
+.dos .hljs-envvar,
+.dos .hljs-stream,
+.hljs-variable,
+.apache .hljs-sqbracket {
   color: #EFDCBC;
 }
 
-pre .dos .flow,
-pre .diff .change,
-pre .python .exception,
-pre .python .built_in,
-pre .literal,
-pre .tex .special {
+.dos .hljs-flow,
+.diff .hljs-change,
+.python .exception,
+.python .hljs-built_in,
+.hljs-literal,
+.tex .hljs-special {
   color: #EFEFAF;
 }
 
-pre .diff .chunk,
-pre .subst {
+.diff .hljs-chunk,
+.hljs-subst {
   color: #8F8F8F;
 }
 
-pre .dos .keyword,
-pre .python .decorator,
-pre .title,
-pre .haskell .type,
-pre .diff .header,
-pre .ruby .class .parent,
-pre .apache .tag,
-pre .nginx .built_in,
-pre .tex .command,
-pre .prompt {
+.dos .hljs-keyword,
+.python .hljs-decorator,
+.hljs-title,
+.haskell .hljs-type,
+.diff .hljs-header,
+.ruby .hljs-class .hljs-parent,
+.apache .hljs-tag,
+.nginx .hljs-built_in,
+.tex .hljs-command,
+.hljs-prompt {
     color: #efef8f;
 }
 
-pre .dos .winutils,
-pre .ruby .symbol,
-pre .ruby .symbol .string,
-pre .ruby .string {
+.dos .hljs-winutils,
+.ruby .hljs-symbol,
+.ruby .hljs-symbol .hljs-string,
+.ruby .hljs-string {
   color: #DCA3A3;
 }
 
-pre .diff .deletion,
-pre .string,
-pre .tag .value,
-pre .preprocessor,
-pre .built_in,
-pre .sql .aggregate,
-pre .javadoc,
-pre .smalltalk .class,
-pre .smalltalk .localvars,
-pre .smalltalk .array,
-pre .css .rules .value,
-pre .attr_selector,
-pre .pseudo,
-pre .apache .cbracket,
-pre .tex .formula,
-pre .coffeescript .attribute {
+.diff .hljs-deletion,
+.hljs-string,
+.hljs-tag .hljs-value,
+.hljs-preprocessor,
+.hljs-pragma,
+.hljs-built_in,
+.sql .hljs-aggregate,
+.hljs-javadoc,
+.smalltalk .hljs-class,
+.smalltalk .hljs-localvars,
+.smalltalk .hljs-array,
+.css .hljs-rules .hljs-value,
+.hljs-attr_selector,
+.hljs-pseudo,
+.apache .hljs-cbracket,
+.tex .hljs-formula,
+.coffeescript .hljs-attribute {
   color: #CC9393;
 }
 
-pre .shebang,
-pre .diff .addition,
-pre .comment,
-pre .java .annotation,
-pre .template_comment,
-pre .pi,
-pre .doctype {
+.hljs-shebang,
+.diff .hljs-addition,
+.hljs-comment,
+.java .hljs-annotation,
+.hljs-template_comment,
+.hljs-pi,
+.hljs-doctype {
   color: #7F9F7F;
 }
 
-pre .coffeescript .javascript,
-pre .javascript .xml,
-pre .tex .formula,
-pre .xml .javascript,
-pre .xml .vbscript,
-pre .xml .css,
-pre .xml .cdata {
+.coffeescript .javascript,
+.javascript .xml,
+.tex .hljs-formula,
+.xml .javascript,
+.xml .vbscript,
+.xml .css,
+.xml .hljs-cdata {
   opacity: 0.5;
 }
 
diff --git a/src/test.html b/src/test.html
index f7bdd6c..435b0c7 100755
--- a/src/test.html
+++ b/src/test.html
@@ -35,6 +35,18 @@
   <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">
+  <link rel="alternate stylesheet" title="Atelier Dun - Dark" href="styles/atelier-dune.dark.css">
+  <link rel="alternate stylesheet" title="Atelier Dun - Light" href="styles/atelier-dune.light.css">
+  <link rel="alternate stylesheet" title="Atelier Forest - Dark" href="styles/atelier-forest.dark.css">
+  <link rel="alternate stylesheet" title="Atelier Forest - Light" href="styles/atelier-forest.light.css">
+  <link rel="alternate stylesheet" title="Atelier Heath - Dark" href="styles/atelier-heath.dark.css">
+  <link rel="alternate stylesheet" title="Atelier Heath - Light" href="styles/atelier-heath.light.css">
+  <link rel="alternate stylesheet" title="Atelier Lakeside - Dark" href="styles/atelier-lakeside.dark.css">
+  <link rel="alternate stylesheet" title="Atelier Lakeside - Light" href="styles/atelier-lakeside.light.css">
+  <link rel="alternate stylesheet" title="Atelier Seaside - Dark" href="styles/atelier-seaside.dark.css">
+  <link rel="alternate stylesheet" title="Atelier Seaside - Light" href="styles/atelier-seaside.light.css">
+  <link rel="alternate stylesheet" title="Paraíso - Dark" href="styles/paraiso.dark.css">
+  <link rel="alternate stylesheet" title="Paraíso - Light" href="styles/paraiso.light.css">
 
   <style>
     body {
@@ -93,14 +105,14 @@
     .code {
       font: medium monospace;
     }
-    .code .keyword {
+    .code .hljs-keyword {
       font-weight: bold;
     }
   </style>
 
   <script src="../build/highlight.pack.js"></script>
   <script>
-  hljs.tabReplace = '    ';
+  hljs.configure({tabReplace: '    '});
   hljs.initHighlightingOnLoad();
   </script>
 
@@ -190,7 +202,7 @@ def somefunc(param1='', param2=0):
     r'''A docstring'''
     if param1 > param2: # interesting
         print 'Gre\'ater'
-    return (param2 - param1 + 1) or None
+    return (param2 - param1 + 1 + 0b10l) or None
 
 class SomeClass:<br>    pass
 
@@ -224,7 +236,8 @@ 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' + ?\012)
+      answer = valid?4 && valid?CONST && ?A && ?A.ord
     end.join
   end
 
@@ -235,12 +248,18 @@ end
 anIdentifier = an_identifier
 Constant = 1
 render action: :new
+
+str =~ /^(?:foo)$/
+str =~ %r{foo|bar|buz$}
+str =~ %r!foo|bar$!
+str =~ %r[foo|bar$]
+str =~ %r(\(foo|bar\)$)
 </code></pre>
 
   <tr>
     <th>Haml
     <td class="haml">
-    <pre><code>!!! XML
+<pre><code>!!! XML
 %html
   %body
     %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
@@ -254,7 +273,7 @@ render action: :new
     ~ variable3
     ~variable4
     The current year is #{DataTime.now.year}.
-    </code></pre>
+</code></pre>
 
   <tr>
     <th>Perl
@@ -273,6 +292,7 @@ sub load
   my $vt;
   $string =~ m/^sought_text$/;
   $items = split //, 'abc';
+  $string //= "bar";
   for my $key (keys %$p)
   {
     if(${$vt.'::property'}) {
@@ -293,31 +313,40 @@ POD till the end of file
     <td class="php">
 <pre><code>require_once 'Zend/Uri/Http.php';
 
-abstract class URI extends BaseURI
+namespace Location\Web;
+
+interface Factory
 {
+    static function _factory();
+}
 
-  /**
-   * Returns a URI
-   *
-   * @return  URI
-   */
-  static public function _factory($stats = array(), $uri = 'http')
-  {
-      $uri = explode(':', $uri, 0b10);
-      $schemeSpecific = isset($uri[1]) ? $uri[1] : '';
-      $desc = 'Multi
+abstract class URI extends BaseURI implements Factory
+{
+    abstract function test();
+
+    /**
+     * Returns a URI
+     *
+     * @return URI
+     */
+    static public function _factory($stats = array(), $uri = 'http')
+    {
+        echo __METHOD__;
+        $uri = explode(':', $uri, 0b10);
+        $schemeSpecific = isset($uri[1]) ? $uri[1] : '';
+        $desc = 'Multi
 line description';
 
-      // Security check
-      if (!ctype_alnum($scheme)) {
-          throw new Zend_Uri_Exception('Illegal scheme');
-      }
+        // Security check
+        if (!ctype_alnum($scheme)) {
+            throw new Zend_Uri_Exception('Illegal scheme');
+        }
 
-      return [
-        'uri' => $uri,
-        'value' => null,
-      ];
-  }
+        return [
+            'uri'   => $uri,
+            'value' => null,
+        ];
+    }
 }
 
 __halt_compiler () ; datahere
@@ -369,13 +398,11 @@ object Maps {
 
 import (
     "fmt"
-    "rand"
     "os"
 )
 
 const (
     Sunday = iota
-    Partyday
     numberOfDays  // this constant is not exported
 )
 
@@ -383,12 +410,9 @@ type Foo interface {
     FooFunc(int, float32) (complex128, []int)
 }
 
-// simple comment
 type Bar struct {
-    os.File /* multi
-    line
-    comment */
-
+    os.File /* multi-line
+               comment */
     PublicData chan int
 }
 
@@ -397,7 +421,6 @@ func main() {
     ch <- 1
     x, ok := <- ch
     ok = true
-    x = nil
     float_var := 1.0e10
     defer fmt.Println('\'')
     defer fmt.Println(`exitting now\`)
@@ -405,7 +428,6 @@ func main() {
     go println(len("hello world!"))
     return
 }
-
 </code></pre>
 
   <tr>
@@ -448,39 +470,44 @@ func main() {
   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`));
+    var("class1.name" = (found_count != 0 ? "subtotal" | "nonefound"),
+        "total_amount" = found_count);
     records;
-      output: ?><tr>[loop_count]</tr><?=;
+      output: "<tr>"loop_count"</tr&gt";
     /records;
   /Inline;
-?><div class="[$class.name]">[found_count]</div>
-[noprocess] causes [delimiters] to be skipped until the next [/noprocess]
+?><div class="[$class1.name]">[$total_amount]</div>
 <?lasso
-/* Lasso 9 */
+/* Lasso 9 */ ?>
+[noprocess] causes [delimiters] to be <?=skipped?> until the next [/noprocess]
+[
   define strings_combine(value::string, ...other)::string => {
-    local(result = #value->append(#other->asString))
+    local(result = #value->append(#other->asString&trim))
     return #result
   }
   /**! descriptive text */
   define person => type {
-    data name::string, protected nickname
-    data birthdate::date
+    parent entity
+    data name::string, protected nickname, birthdate :: date
     data private ssn = null
-    public showName() => return .'name'
-    protected fullName() => '"' + .nickname + '"' + .'name'
-    public ssnListed => .ssn ? true | false
+    private showAge() => { return ..age }
+    protected fullName() => `"` + .nickname + `"` + .'name'
+    public ssnListed::boolean => .ssn() ? true | false
   }
   define person->name=(value) => {
     .'name' = #value
     return self->'name'
   }
+] <!-- an HTML comment <?=disables delimiters?> as well -->
+[no_square_brackets] disables [square brackets] for the rest of the file
+<?=
   // query expression
-  with n in array(-1, 0xABCD, 3.14159e14)
+  with n in array((:-12, 0xABCD, 3.14159e14), (:NaN, -infinity, .57721))
   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)
+  select pair(#key, #1)
   do {^
     #n->upperCase
   ^}
@@ -493,7 +520,7 @@ func main() {
 <pre>
 <code># hello world
 
-you can write text [with links](http://example.com).
+you can write text [with links](http://example.com) inline or [link references][1].
 
 * one _thing_ has *em*phasis
 * two __things__ are **bold**
@@ -511,6 +538,8 @@ hello world
 
 1. one thing (yeah!)
 2. two thing `i can write code`, and `more` wipee!
+
+[1]: http://example.com
 </code></pre>
 
 	<tr>
@@ -528,6 +557,8 @@ using an explicit link:http://example.com[link prefix].
 ** 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+
+* `smart' quotes using a leading backtick and trailing single quote
+** use two of each for double ``smart'' quotes
 
 - escape characters are supported
 - you can escape a quote inside emphasized text like 'here\'s johnny!'
@@ -590,15 +621,15 @@ NOTE: AsciiDoc is quite cool, you should try it.</code></pre>
 {# Striped table #}
 <tr class="{% cycle odd,even %}">
   <td>{{ article|default:"Hi... "|escape }}</td>
-  <td {% if article.today %}class="today"{% endif %}>{{ article.date|date:"d.m.Y" }}</td>
+  <td {% if article.today %}class="today"{% endif %}>{{ article.date|date:'d.m.Y' }}</td>
 </tr>
 
 {% endfor %}
 {% endif %}
 
 {% comment %}
-Comments may be long and
-multiline.
+Comments may be long and multiline.
+Markup is <em>not</em> highlighted within comments.
 {% endcomment %}
 </code></pre>
 
@@ -745,10 +776,9 @@ a {
 <pre><code>function $initHighlight(block, flags) {
   try {
     if (block.className.search(/\bno\-highlight\b/) != -1)
-      return processBlock(block, true, 0x0F) + ' class=""';
+      return processBlock(block.function, true, 0x0F) + ' class=""';
   } catch (e) {
     /* handle exception */
-
     var e4x =
         <div>Example
             <p>1234</p></div>;
@@ -757,6 +787,7 @@ a {
     if (checkCondition(classes[i]) === undefined)
       return /\d+[\s/]/g;
   }
+  console.log(Array.every(classes, Boolean));
 }</code></pre>
 
   <tr>
@@ -775,6 +806,7 @@ x = f /foo * 2/6
 x = f /6 * 2/ - 3
 x = f /foo * 2/gm
 x = if true then /\n/ else /[.,]+/
+x = ///^key-#{key}-\d+///
 
 grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
   if student.excellentWork
@@ -997,31 +1029,31 @@ do shell script "/bin/echo 'hello'"
   <tr>
     <th>Delphi
     <td class="delphi">
-<pre><code>TList=Class(TObject)
+<pre><code>TList = Class(TObject)
 Private
   Some: String;
 Public
   Procedure Inside; // Suxx
 End;{TList}
 
-Procedure CopyFile(InFileName,var OutFileName:String);
+Procedure CopyFile(InFileName, var OutFileName: String);
 Const
-  BufSize=4096; (* Huh? *)
+  BufSize = 4096; (* Huh? *)
 Var
-  InFile,OutFile:TStream;
-  Buffer:Array[1..BufSize] Of Byte;
-  ReadBufSize:Integer;
+  InFile, OutFile: TStream;
+  Buffer: Array[1..BufSize] Of Byte;
+  ReadBufSize: Integer;
 Begin
-  InFile:=Nil;
-  OutFile:=Nil;
+  InFile := Nil;
+  OutFile := Nil;
   Try
-    InFile:=TFileStream.Create(InFileName,fmOpenRead);
-    OutFile:=TFileStream.Create(OutFileName,fmCreate);
+    InFile := TFileStream.Create(InFileName, fmOpenRead);
+    OutFile := TFileStream.Create(OutFileName, fmCreate);
     Repeat
-      ReadBufSize:=InFile.Read(Buffer,BufSize);
-      OutFile.Write(Buffer,ReadBufSize);
+      ReadBufSize := InFile.Read(Buffer, BufSize);
+      OutFile.Write(Buffer, ReadBufSize);
     Until ReadBufSize<>BufSize;
-    Log('File '''+InFileName+''' copied'#13#10);
+    Log('File ''' + InFileName + ''' copied'#13#10);
   Finally
     InFile.Free;
     OutFile.Free;
@@ -1030,6 +1062,67 @@ End;{CopyFile}
 </code></pre>
 
   <tr>
+    <th>Oxygene
+    <td class="oxygene">
+<pre><code>namespace LinkedList;
+
+interface
+
+uses
+  System.Text;
+
+type
+  List<T> = public class
+    where T is Object;
+  private
+    method AppendToString(aBuilder: StringBuilder);
+  public
+    constructor(aData: T);
+    constructor(aData: T; aNext: List<T>);
+    property Next: List<T>;
+    property Data: T;
+
+    method ToString: string; override;
+  end;
+
+implementation
+
+constructor List<T>(aData: T);
+begin
+  Data := aData;
+end;
+
+constructor List<T>(aData: T; aNext: List<T>);
+begin
+  constructor(aData);
+  Next := aNext;
+end;
+
+method List<T>.ToString: string;
+begin
+  with lBuilder := new StringBuilder do begin
+    AppendToString(lBuilder);
+    result := lBuilder.ToString();
+  end;
+end;
+
+method List<T>.AppendToString(aBuilder: StringBuilder);
+begin
+  if assigned(Data) then
+    aBuilder.Append(Data.ToString)
+  else
+    aBuilder.Append('nil');
+
+  if assigned(Next) then begin
+    aBuilder.Append(', ');
+    Next.AppendToString(aBuilder);
+  end;
+end;
+
+end.
+</code></pre>
+
+  <tr>
     <th>Java
     <td class="java">
 <pre><code>/**
@@ -1058,7 +1151,7 @@ public abstract class L2Character extends L2Object {
 
     public void run() {
       try {
-        getAI().notifyEvent(_evt, null, null);
+        getAI().notifyEvent(_evt, _evt.class, null);
       } catch (Throwable t) {
         t.printStackTrace();
       }
@@ -1071,6 +1164,7 @@ public abstract class L2Character extends L2Object {
     <th>C++
     <td class="cpp">
 <pre><code>#include <iostream>
+#define IABS(x) ((x) < 0 ? -(x) : (x))
 
 int main(int argc, char *argv[]) {
 
@@ -1270,6 +1364,35 @@ let minutte = 60<s>
 
 </code></pre>
 
+  <tr>
+    <th>OCaml
+    <td class="ocaml">
+<pre>
+<code>(* This is a
+multiline, (* nested *) comment *)
+type point = { x: float; y: float };;
+let some_string = "this is a string";;
+let rec length lst =
+    match lst with
+      [] -> 0
+    | head :: tail -> 1 + length tail
+  ;;
+exception Test;;
+type expression =
+      Const of float
+    | Var of string
+    | Sum of expression * expression    (* e1 + e2 *)
+    | Diff of expression * expression   (* e1 - e2 *)
+    | Prod of expression * expression   (* e1 * e2 *)
+    | Quot of expression * expression   (* e1 / e2 *)
+class point =
+    object
+      val mutable x = 0
+      method get_x = x
+      method private move d = x <- x + d
+    end;;
+</code></pre>
+
 <tr>
     <th>D
     <td class="d">
@@ -1533,40 +1656,24 @@ heapExample
  <tr>
     <th>Clojure
     <td class="clojure">
-<pre><code>;   You must not remove this notice, or any other, from this software.
-
-(ns ^{:doc "The core Clojure language."
-       :author "Rich Hickey"}
-  clojure.core)
-
-(def unquote)
+<pre><code>; Comment
 
 (def
   ^{:macro true
     :added "1.0"}
   let (fn* let [&form &env & decl] (cons 'let* decl)))
 
-(def
+(def ^:dynamic chunk-size 17)
 
- defn (fn defn [&form &env name & fdecl]
-        (let [m (conj {:arglists (list 'quote (sigs fdecl))} m)
-              m (let [inline (:inline m)
-                      ifn (first inline)
-                      iname (second inline)]
-                  ;; same as: (if (and (= 'fn ifn) (not (symbol? iname))) ...)
-                  (if (if (clojure.lang.Util/equiv 'fn ifn)
-                        (if (instance? clojure.lang.Symbol iname) false true))
-                    ;; inserts the same fn name to the inline fn if it does not have one
-                    (assoc m :inline (cons ifn (cons (clojure.lang.Symbol/intern (.concat (.getName ^clojure.lang.Symbol name) "__inliner"))
-                                                     (next inline))))
-                    m))
-              m (conj (if (meta name) (meta name) {}) m)]
-          (list 'def (with-meta name m)
-                ;;todo - restore propagation of fn name
-                ;;must figure out how to convey primitive hints to self calls first
-                (cons `fn fdecl) ))))
+(defn next-chunk [rdr]
+  (let [buf (char-array chunk-size)
+        s (.read rdr buf)]
+  (when (pos? s)
+    (java.nio.CharBuffer/wrap buf 0 s))))
 
-(. (var defn) (setMacro))
+(defn chunk-seq [rdr]
+  (when-let [chunk (next-chunk rdr)]
+    (cons chunk (lazy-seq (chunk-seq rdr)))))
 </code></pre>
 
   <tr>
@@ -1598,6 +1705,9 @@ RewriteRule . index.php [NC,L]
 ExpiresActive On
 ExpiresByType application/x-javascript  "access plus 1 days"
 
+Order Deny,Allow
+Allow from All
+
 <Location /maps/>
   RewriteMap map txt:map.txt
   RewriteMap lower int:tolower
@@ -1759,32 +1869,45 @@ genApacheConf(){
 </code></pre>
 
   <tr>
-    <th>CMake
-    <td class="cmake">
-<pre><code>project(test)
-cmake_minimum_required(VERSION 2.6)
+    <th>Makefile
+    <td class="makefile">
+<pre><code># Makefile
 
-# IF LINUX
-if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
-    message("\nOS:\t\tLinux")
-endif()
+BUILDDIR      = _build
+EXTRAS       ?= $(BUILDDIR)/extras
 
-# IF WINDOWS
-if (${CMAKE_SYSTEM_NAME} MATCHES Windows)
-    message("\nOS:\t\tWindows")
-endif()
+.PHONY: main clean
 
-set(test test0.cpp test1.cpp test2.cpp)
+main:
+	@echo "Building main facility..."
+	build_main $(BUILDDIR)
 
-include_directories(./)
+clean:
+	rm -rf $(BUILDDIR)/*
+</code></pre>
 
-set(EXECUTABLE_OUTPUT_PATH ../bin)
+  <tr>
+    <th>CMake
+    <td class="cmake">
+<pre><code>cmake_minimum_required(VERSION 2.8.8)
+project(cmake_example)
 
-add_subdirectory(src)
+# Show message on Linux platform
+if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
+    message("Good choice, bro!")
+endif()
 
-add_executable(test WIN32 ${test})
+# Tell CMake to run moc when necessary:
+set(CMAKE_AUTOMOC ON)
+# As moc files are generated in the binary dir,
+# tell CMake to always look for includes there:
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
-target_link_libraries(test msimg32)
+# Widgets finds its own dependencies.
+find_package(Qt5Widgets REQUIRED)
+
+add_executable(myproject main.cpp mainwindow.cpp)
+qt5_use_modules(myproject Widgets)
 </code></pre>
 
   <tr>
@@ -1868,8 +1991,7 @@ EMPTY_HNDL = INTDCREATEHANDLE('05/03/2006 00:00:00', '05/03/2006 23:59:59', 3600
   <tr>
     <th>1С
     <td class="1c">
-<pre><code>
-#Если Клиент Тогда
+<pre><code>#Если Клиент Тогда
 Перем СимвольныйКодКаталога = "ля-ля-ля"; //комментарий
 Функция Сообщить(Знач ТекстСообщения, ТекстСообщения2) Экспорт //комментарий к функции
   x=ТекстСообщения+ТекстСообщения2+"
@@ -1997,6 +2119,65 @@ class
 </code></pre>
 
   <tr>
+    <th>LiveCode Server
+    <td class="livecodeserver">
+<pre><code><?rev
+
+global gControllerHandlers, gData
+local sTest
+put "blog,index" into gControllerHandlers
+
+
+command blog
+  put "Hello World!" into sTest
+  put "form,url,asset" into tHelpers
+  rigLoadHelper tHelpers
+end blog
+
+
+command index
+  -- simple comment
+  put "YourPageTitle" into gData["pageTitle"]
+
+  # ANOTHER COMMENT
+  get rigLoadView("blogView")
+end index
+
+
+/*Hello
+block comment!*/
+
+
+command rigCommand pParam1 pParam2
+  put empty into sEmptyLocal
+  // comment
+  put "test" contains "es" into tTemp
+  put "test" & $_POST["post"] into tTestVar
+  put rigFunction(tTestVar) into gData["arrayVal"]
+end rigCommand
+
+
+function rigFunction pParam
+  rigAnotherCommand pParamA, pPAramB
+  return "bla" && pParam & comma
+end rigFunction
+
+
+function myFunction
+  if the secs > 2000000000 then
+    put "Welcome to the future!"
+  else
+    return "something"
+  end if
+end myFunction
+
+
+--| END OF blog.lc
+--| Location: ./system/application/controllers/blog.lc
+----------------------------------------------------------------------
+</code></pre>
+
+  <tr>
     <th>TeX
     <td class="tex">
 <pre>
@@ -2027,7 +2208,7 @@ $$
   ->+++>++++++++++<<
 ]>>
 [ filling cells
-  ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[<]<[<]<[<]>>
+  ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>>
 ]<
 +++++++++<<
 [ rough codes correction loop
@@ -2064,6 +2245,10 @@ import Data.ByteString.Char8 (pack, unpack)
 import Network.Socket hiding (sendTo, recv, recvFrom)
 import Network.Socket.ByteString (sendTo, recv, recvFrom)
 
+infix 3 `foo`
+infixl 6 `bar`
+infixr 9 `baz`
+
 -- Type class for converting StringLike types to and from strict ByteStrings
 class DataPacket a where
   toStrictBS :: a -> Strict.ByteString
@@ -2284,6 +2469,25 @@ foo_cell = {1, 2, 3; 4, 5, 6}''.'.';
 </code></pre>
 
   <tr>
+    <th>Scilab
+    <td class="scilab">
+<pre><code>// A comment
+function I = foo(dims, varargin)
+  d=[1; matrix(dims(1:$-1),-1,1)]
+  for i=1:size(varargin)
+    if varargin(i)==[] then
+       I=[],
+       return;
+    end
+  end
+endfunction
+
+b = cos(a) + cosh(a);
+bar_matrix = [ "Hello", "world" ];
+foo_matrix = [1, 2, 3; 4, 5, 6];
+</code></pre>
+
+  <tr>
     <th>R
     <td class="r">
 <pre><code>library(ggplot2)
@@ -2357,7 +2561,6 @@ foo %union% bar
 
 </code></pre>
 
-
   <tr>
     <th>Mizar
     <td class="mizar">
@@ -2448,6 +2651,64 @@ then  y in ProperPrefixes v or y = v & v in ProperPrefixes (v^<*x*>)
   hence thesis by A4;
 end;</code></pre>
 
+  <tr>
+    <th>Mathematica</th>
+    <td class="mathematica">
+<pre>
+<code>(* ::Package:: *)
+
+(* Mathematica Package *)
+
+BeginPackage["SomePkg`"]
+
+Begin["`Private`"]
+
+SomeFn[ns_List] := Fold[Function[{x, y}, x + y], 0, Map[# * 2 &, ns]];
+Print[$ActivationKey];
+
+End[] (* End Private Context *)
+
+EndPackage[]
+</code></pre>
+
+  <tr>
+    <th>AutoHotkey</th>
+    <td class="autohotkey">
+<pre>
+<code>; hotkeys and hotstrings
+#a::WinSet, AlwaysOnTop, Toggle, A
+#Space::
+  MsgBox, Percent sign (`%) need to be escaped.
+  Run "C:\Program Files\some\program.exe"
+  Gosub, label1
+return
+::btw::by the way
+; volume
+#Numpad8::Send {Volume_Up}
+#Numpad5::Send {Volume_Mute}
+#Numpad2::Send {Volume_Down}
+
+label1:
+  if (Clipboard = "")
+  {
+    MsgBox, , Clipboard, Empty!
+  }
+  else
+  {
+    StringReplace, temp, Clipboard, old, new, All
+    MsgBox, , Clipboard, %temp%
+  }
+return
+</code></pre>
+
+  <tr>
+    <th>FIX
+    <td class="fix">
+<pre>
+<code>8=FIX.4.2␁9=0␁35=8␁49=SENDERTEST␁56=TARGETTEST␁34=00000001526␁52=20120429-13:30:08.137␁1=ABC12345␁11=2012abc1234␁14=100␁17=201254321␁20=0␁30=NYSE␁31=108.20␁32=100␁38=100␁39=2␁40=1␁47=A␁54=5␁55=BRK␁59=2␁60=20120429-13:30:08.000␁65=B␁76=BROKER␁84=0␁100=NYSE␁111=100␁150=2␁151=0␁167=CS␁377=N␁10000=SampleCustomTag␁10=123␁
+
+8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123
+</code></pre>
 </table>
 
 <script>
@@ -2461,22 +2722,19 @@ end;</code></pre>
     var failed = [];
     for (var i = 0; i < tds.length; i++) {
       var tdClass = tds[i].className;
-      if (!hljs.LANGUAGES.hasOwnProperty(tdClass)) {
+      if (!hljs.getLanguage(tdClass)) {
         tds[i].parentNode.style.display = 'none';
         continue;
       }
       var code = tds[i].getElementsByTagName('CODE')[0];
-      var passed = tdClass == code.className;
+      var langClass = code.className.replace('hljs', '').trim();
+      var passed = tdClass == langClass;
       var result = document.createElement('DIV');
       result.className = 'test';
-      result.innerHTML = '<var class="'+ (passed ? 'passed' : 'failed') +'">' + code.className + '</var>';
-      function counts(r) {
-        return ' (' + r.kw + '+' + r.re + '=' + (r.kw + r.re) + ')';
-      }
-      result.innerHTML += counts(code.result);
+      result.innerHTML = '<var class="'+ (passed ? 'passed' : 'failed') +'">' + langClass + '</var>';
+      result.innerHTML += ' (' + code.result.re + ')';
       if (code.second_best) {
-        result.innerHTML += '<br>' + code.second_best.language +
-                            counts(code.second_best) ;
+        result.innerHTML += '<br>' + code.second_best.language + ' (' + code.second_best.re + ')';
       }
       tds[i].parentNode.getElementsByTagName('th')[0].appendChild(result);
       if (!passed) {
@@ -2548,6 +2806,11 @@ end;</code></pre>
 <script>hljs.highlightBlock(document.getElementById('codecontainer'), null, true);</script>
 
   <tr>
+    <th>Language alias
+    <td>
+      <pre><code class="language-js">var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>';</code></pre>
+
+  <tr>
     <th>Disabled highlighting
     <td>
 <pre><code class="no-highlight"><div id="contents">
diff --git a/tools/build.py b/tools/build.py
index 33aa565..a9b7fd2 100644
--- a/tools/build.py
+++ b/tools/build.py
@@ -10,17 +10,18 @@ import re
 import argparse
 import subprocess
 import json
+import codecs
 from functools import partial
 
 REPLACES = {
     'case_insensitive': 'cI',
-    'lexems': 'l',
+    'lexemes': 'l',
     'contains': 'c',
     'keywords': 'k',
     'subLanguage': 'sL',
     'className': 'cN',
     'begin': 'b',
-    'beginWithKeyword': 'bWK',
+    'beginKeywords': 'bK',
     'end': 'e',
     'endsWithParent': 'eW',
     'illegal': 'i',
@@ -29,6 +30,7 @@ REPLACES = {
     'returnBegin': 'rB',
     'returnEnd': 'rE',
     'relevance': 'r',
+    'variants': 'v',
 
     'IDENT_RE': 'IR',
     'UNDERSCORE_IDENT_RE': 'UIR',
@@ -45,22 +47,37 @@ REPLACES = {
     'C_NUMBER_MODE': 'CNM',
     'BINARY_NUMBER_MODE': 'BNM',
     'NUMBER_MODE': 'NM',
+    'TITLE_MODE': 'TM',
+    'UNDERSCORE_TITLE_MODE': 'UTM',
 
     'beginRe': 'bR',
     'endRe': 'eR',
     'illegalRe': 'iR',
-    'lexemsRe': 'lR',
+    'lexemesRe': 'lR',
     'terminators': 't',
     'terminator_end': 'tE',
 }
 
 CATEGORIES = {
-    'common': ['bash', 'java', 'ini', 'sql', 'diff', 'php', 'cs', 'cpp', 'ruby', 'python', 'css', 'perl', 'xml', 'javascript', 'http', 'json'],
+    'common': [
+        'apache', 'nginx',
+        'java', 'cs', 'cpp', 'objectivec',
+        'ini', 'diff', 'bash', 'makefile',
+        'sql', 'php', 'ruby', 'python', 'perl',
+        'css', 'xml', 'javascript', 'coffeescript', 'http', 'json',
+        'markdown',
+    ],
 }
 
 def lang_name(filename):
     return os.path.splitext(os.path.basename(filename))[0]
 
+# This is used instead of plain `open` everywhere as there are apparently
+# "some systems" that don't use utf-8 as the default system encoding.
+# We should probably drop it in the better, brighter future.
+def utf8_open(filename, mode='r'):
+    return codecs.open(filename, mode, 'utf-8')
+
 def mapnonstrings(source, func):
     result = []
     pos = 0
@@ -106,7 +123,7 @@ 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)
+    content = utf8_open(filename).read(1024)
     match = re.search(r'^\s*/\*(.*?)\*/', content, re.S)
     if not match:
         return
@@ -149,7 +166,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, encoding='utf-8').read()
+    s = utf8_open(filename).read()
     pattern = re.compile(r'^\s*(/\*(.*?)\*/)?\s*', re.DOTALL)
     s = pattern.sub('', s)
     return s.strip()
@@ -167,11 +184,10 @@ def wrap_language(filename, content, compressed):
     '''
     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);'
+        wrap = 'hljs.registerLanguage("%s",%s);'
     else:
-        wrap = 'hljs.LANGUAGES[\'%s\'] = %s(hljs);\n'
+        wrap = '\nhljs.registerLanguage(\'%s\', %s);\n'
     return wrap % (name, content)
 
 def glue_files(hljs_filename, language_filenames, compressed):
@@ -180,64 +196,68 @@ 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, encoding='utf-8').read()
+        file_func = lambda f: utf8_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):
+def build_browser(root, build_path, filenames, options, is_amd=False):
     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)
+    if is_amd:
+        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', encoding='utf-8').write(content)
+    utf8_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', encoding='utf-8').write(content)
+    build_browser(root, build_path, filenames, options, True)
 
 def build_node(root, build_path, filenames, options):
     src_path = os.path.join(root, 'src')
+    os.makedirs(os.path.join(build_path, 'lib', 'languages'))
     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', encoding='utf-8').write(content)
+        utf8_open(os.path.join(build_path, 'lib', 'languages', os.path.basename(filename)), 'w').write(content)
     filename = os.path.join(src_path, 'highlight.js')
     print(filename)
+    core = 'var Highlight = %s;' % strip_read(filename)
+    core += '\nmodule.exports = Highlight;'
+    utf8_open(os.path.join(build_path, 'lib', 'highlight.js'), 'w').write(core)
 
     print('Registering languages with the library...')
-    hljs = 'var hljs = new %s();' % strip_read(filename)
+    hljs = "var Highlight = require('./highlight');\nvar hljs = new Highlight();"
     filenames = map(os.path.basename, filenames)
     for filename in filenames:
-        hljs += '\nhljs.LANGUAGES[\'%s\'] = require(\'./%s\')(hljs);' % (lang_name(filename), filename)
+        hljs += '\nhljs.registerLanguage(\'%s\', require(\'./languages/%s\'));' % (lang_name(filename), filename)
     hljs += '\nmodule.exports = hljs;'
-    open(os.path.join(build_path, 'highlight.js'), 'w', encoding='utf-8').write(hljs)
+    utf8_open(os.path.join(build_path, 'lib', 'index.js'), 'w').write(hljs)
     if options.compress:
         print('Notice: not compressing files for "node" target.')
 
+    print('Copying over Metafiles...')
+
+    filenames = ['LICENSE', 'README.md']
+    for filename in filenames:
+        source = os.path.join(root, filename)
+        dest   = os.path.join(build_path, filename)
+        shutil.copyfile(source, dest)
+
     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')
+    package = json.load(utf8_open(os.path.join(src_path, 'package.json')))
+    authors = utf8_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', encoding='utf-8').write(content)
+    content = json.dumps(package, indent=2, ensure_ascii=False)
+    utf8_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')
@@ -255,7 +275,7 @@ def build_cdn(root, build_path, filenames, options):
         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', encoding='utf-8').write(content)
+        utf8_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')
@@ -264,8 +284,8 @@ def build_cdn(root, build_path, filenames, options):
     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', encoding='utf-8').write(content)
+        content = compress_content(tools_path, utf8_open(filename).read(), 'css')
+        utf8_open(os.path.join(build_style_path, '%s.min.css' % style), 'w').write(content)
 
 def build(buildfunc, root, args):
     build_path = os.path.join(root, 'build')

-- 
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