highlight.js v10.7.0 Release Notes

  • ๐Ÿ“œ Parser:

    • keywords now have a maximum # of times they provide relevance (#3129) Josh Goebel
    • enh(api) add unregisterLanguage method (#3009) Antoine du Hamel
    • enh: Make alias registration case insensitive (#3026) David Ostrovsky
    • ๐Ÿ›  fix(parser) highlightAll() now works if the library is lazy loaded Josh Goebel

    ๐Ÿ†• New Languages:

    • โž• Added 3rd party RiScript grammar to SUPPORTED_LANGUAGES (#2988) [John C][]
    • โž• Added 3rd party HLSL grammar to SUPPORTED_LANGUAGES (#3002) Stef Levesque
    • โž• Added 3rd party Q# grammar to SUPPORTED_LANGUAGES(#3006) Vyron Vasileiadis

    Language grammar improvements:

    • enh(js/ts) class references (CamelCase) are highlighted (#3169) Josh Goebel
    • enh(js/ts) constants (ALL_CAPS) are highlighted (#3169) Josh Goebel
    • enh(js/ts) highlights function invokation (#3169) Josh Goebel
    • enh(js/ts) functions assigned to variables are now highlighted title.function (#3169) Josh Goebel
    • ๐Ÿ“œ enh(parser) smarter detection of comments (#2827) Josh Goebel
    • ๐Ÿ›  fix(python) allow keywords immediately following numbers (#2985) Josh Goebel
    • ๐Ÿ›  fix(xml) char immediately following tag close mis-highlighted (#3044) Josh Goebel
    • ๐Ÿ›  fix(ruby) fix defined?() mis-highlighted as def (#3025) Josh Goebel
    • ๐Ÿ›  fix(c) comments after #include <str> blocks (#3041) Josh Goebel
    • ๐Ÿ›  fix(cpp) comments after #include <str> blocks (#3041) Josh Goebel
    • enh(cpp) Highlight all function dispatches (#3005) Josh Goebel
    • ๐Ÿ‘ enh(python) support type hints and better type support (#2972) Josh Goebel
    • enh(gml) Add additional GML 2.3 keywords (#2984) xDGameStudios
    • ๐Ÿ›  fix(cpp) constructor support for initializers (#3001) Josh Goebel
    • enh(php) Add trait to class-like naming patterns (#2997) Ayesh
    • enh(php) Add Stringable, UnhandledMatchError, and WeakMap classes/interfaces (#2997) Ayesh
    • enh(php) Add mixed to list of keywords (#2997) Ayesh
    • ๐Ÿ‘ enh(php) Add support binary, octal, hex and scientific numerals with underscore separator support (#2997) Ayesh
    • ๐Ÿ‘ enh(php) Add support for Enums (#3004) Ayesh
    • enh(ecmascript) Add built-in types Vaibhav Chanana
    • enh(kotlin) Add kts as an alias for Kotlin (#3021) Vaibhav Chanana
    • enh(css) Add font-smoothing to attributes list for CSS (#3027) AndyKIron
    • ๐Ÿ›  fix(python) Highlight print and exec as a builtin (#1468) Samuel Colvin
    • ๐Ÿ›  fix(csharp) Fix unit being highlighted instead of uint (#3046) [Spacehamster][]
    • enh(swift) add async/await keywords (#3048) [Bradley Mackey][]

    ๐Ÿ—„ Deprecations:

    • ๐Ÿ—„ highlight(languageName, code, ignoreIllegals, continuation) deprecated as of 10.7
      • Please use the newer API which takes code and then accepts options as an object
      • IE: highlight(code, {language, ignoreIllegals})
      • continuation is for internal use only and no longer supported
    • ๐Ÿ—„ highlightBlock(el) deprecated as of 10.7.
      • Please use highlightElement(el) instead.
      • Plugin callbacks renamed before/after:highlightBlock => before/after:highlightElement
      • Plugin callback now takes el vs block attribute
      • The old API and callbacks will be supported until v12.