npm / highlight.js
highlight.js
What changed in highlight.js 11, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
1 breaking3 security26 new APIs and options22 behavior and defaults32 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inithighlight.js 1184 changes
Breaking changes 1
Gherkin variables no longer allow whitespace.
Security 3
Bounds the run of type tokens before a function name to mitigate ReDoS.
Bounds the run of type tokens before a function name to mitigate ReDoS.
Removes recursive sublanguage references to prevent ReDoS.
New APIs and options 26
Adds the third-party Cedar grammar to the supported languages.
Adds the third-party DAX grammar to the supported languages.
Adds a grammar for FreeDesktop configuration files, including .desktop and systemd files.
Adds the third-party Djot grammar to the supported languages.
Adds batch as an alias for the DOS grammar.
Adds the Equinox theme.
Adds the third-party Igor Pro grammar to the supported languages.
Adds the third-party Jaiva grammar to the supported languages.
Adds ktm and ktx as Kotlin aliases.
Adds the third-party Liquidsoap grammar to the supported languages.
Adds the third-party M (Power Query) grammar to the supported languages.
Adds the third-party MoonBit grammar to the supported languages.
Adds the third-party Pkl grammar to the supported languages.
Adds the third-party RAScript grammar to the supported languages.
Adds the third-party Veryl grammar to the supported languages.
Adds the third-party Why3 grammar to the supported languages.
Adds the third-party Xojo grammar to the supported languages.
Adds the 3rd party Abc Notation grammar to supported languages.
Adds the 3rd party Aiken grammar to supported languages.
Adds the 3rd party Bicep grammar to supported languages.
Adds the 3rd party Gleam grammar to supported languages.
Adds the 3rd party L4 grammar to supported languages.
Adds the 3rd party Magik grammar to supported languages.
Adds the 3rd party Prisma grammar to supported languages.
Adds the 3rd party VoltScript grammar to supported languages.
Adds the "vs Dark " theme.
Behavior and default changes 22
Adds the block and endblock keywords to CMake highlighting.
Supports digit separators in binary literals and numeric type suffixes, and no longer highlights an identifier's leading underscore.
Adds highlighting for corner-shape properties.
CSS highlighting now supports six-digit unicode-range values.
Adds highlighting for class and function names.
Highlights registered CAA property tags.
Improves highlighting for character strings, TXT records, classes, escapes, and addresses.
Updates the Gherkin keyword list.
Gherkin docstrings can now use backticks.
Recognizes binary integer literals.
Supports underscores in numeric literals.
Adds self to the built-in variables recognized by JavaScript highlighting.
Supports block C-style comments.
Adds the Lua 5.5 global keyword to highlighting.
Enhances NSIS highlighting rules.
Adds support for highlighting t-strings.
Adds the safe keyword to Rust highlighting.
Parses f16 and f128 literals.
Updates SQF highlighting to Arma 3 v2.22.
The build now allows third-party packages to override default languages.
Adds the parallel keyword and allows [] for Ada 2022.
Adds JSON5 support to the JSON grammar.
Fixes and other changes 32
C highlighting now matches only actual atomic_* type names, not C11 atomic functions.
Angle-bracket header strings are now scoped to #include directives.
A raw string's closing delimiter no longer swallows quotes.
Only standalone numbers are highlighted; digits beginning identifiers such as 3rdparty are not.
Angle-bracket header strings are now scoped to #include directives.
A raw string's closing delimiter no longer swallows quotes.
Numeric literals now require a preceding word boundary, preventing digits inside identifiers from being highlighted as numbers.
Integer division with // is no longer treated as a regex literal.
Highlights where in GADT and closed type-family declarations.
Improves type detection, including generic and array types.
Fixes a bug in Leaf keyword highlighting.
Preserves highlighting after quoted multiplication expressions.
Thematic breaks made of *** or ___ are no longer treated as the start of bold text.
The Mode.keywords type now allows RegExp.
Parser rewriting now counts named capture groups when rewriting backreferences, fixing incorrect backreference handling.
Adds the aiter, anext, frozendict, and sentinel builtins to Python highlighting.
Correctly highlights lazy import syntax from PEP 810.
The scope resolution operator :: is no longer treated as a symbol.
Includes the raw borrow operator in Rust keywords.
Allows function invocations whose names start with a keyword.
Recognizes \\ and \" character-literal escapes so highlighting does not leak.
Matches periods as part of shell prompts.
Excludes keywords from function calls when highlighting C++.
Adds support for digit separators.
Adds 7 missing directives and keywords from MDN to the CSP grammar.
Fixes
unicode-rangeparsing.Fixes cybertopia theme rendering in shadow DOM.
Fixes unified diff hunk header matching to allow unpaired numbers.
Fixes illegal handling at the end of input code.
Adds support for the
?'character literal and the missingdefguardpkeyword.Correctly highlights 'for await' again.
Supports single-line and hash comments in attributes, constructors, and functions.