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.
- 0️⃣ Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
- 💎 comments now allowed inside Ruby function definition
- MEL language from Shuen-Huei Guan
- whitespace now allowed between
- 👍 better auto-detection of C++ and PHP
- HTML allows embedded VBScript (
<% .. %>)
- 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
- Zenburn from Vladimir Epifanov, this is an imitation of a well-known theme for Vim.
- 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 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.
🔊 [alenacpp]: http://alenacpp.blogspot.com/
🆕 New major version is a result of vast refactoring and of many contributions.
Visible new features:
- 💅 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.
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 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 (
<? ... ?>).
[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/
- 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!
Three new languages are available: Django templates, SQL and Axapta. The latter two are sent by Dmitri Roudakov. 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!
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.
- 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.
📜 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
- 💎 in-string substitutions for Ruby --