highlight.js v10.6.0 Release Notes

  • ๐Ÿ†• New Languages:

    • โž• Added 3rd party Laravel Blade grammar to SUPPORTED_LANGUAGES (#2944) Michael Newton

    Language grammar improvements:

    • enh(scala) fix triple quoted strings (#2987) Josh Goebel
    • enh(perl) Much improved regex detection (#2960) Josh Goebel
    • enh(swift) Improved highlighting for operator and precedencegroup declarations. (#2938) Steven Van Impe
    • ๐Ÿ›  fix(xml) Support single-character namespaces. (#2957) Jan Pilzer
    • ๐Ÿ’Ž enh(ruby) Support for character literals (#2950) Vaibhav Chanana
    • โšก๏ธ enh(powershell) Add three VALID_VERBS and update the reference link (#2981) davidhcefx
    • ๐Ÿ›  fix(php) Highlighting of anonymous functions without {} block Vaibhav Chanana

    ๐Ÿ—„ Grammar Deprecations:

    • ๐Ÿ—„ Deprecate c-like, though you should not be using it directly anyways.
      • will be removed in v11.
    • c and cpp are now wholly unique grammars that will diverge over time

    ๐Ÿ“œ Parser:

    • ๐Ÿ†• new simpler highlightAll() API (#2962) Josh Goebel
      • this should be a drop-in replacement for both initHighlighting() and initHighlightingOnLoad()
      • note: it does not prevent itself from being called multiple times (as the previous API did)
    • beginKeyword no longer bestows double relevance (#2953) Josh Goebel
    • ๐Ÿ‘ allow keywords to be an array of strings Josh Goebel
    • add modes.MATCH_NOTHING_RE that will never match
      • This can be used with end to hold a mode open (it must then be ended with endsParent in one of it's children modes) Josh Goebel

    ๐Ÿ—„ Deprecations:

    • ๐Ÿ—„ initHighlighting() and initHighlightingOnLoad() deprecated.
      • Please use the new highlightAll() API instead.
      • Deprecated as of 10.6.
      • These will both be aliases to highlightAll in v11.