JavaScript syntax highlighter with language auto-detection and zero dependencies.
Grammars:
catch
keyword (#3251) Konrad Rudolph
pwsh
alias (#3236) tebeco
edn
alias (#3213) Stel Abrego
No other changes.
This is a major release. As such it contains breaking changes which may require action from users. Most of the breaking changes work was done by the current maintainer Josh Goebel (ref: #2558) while many other contributors contributed many other changes for this release. You'll find that list below the breaking changes summary.
Please read VERSION_11_UPGRADE.md for a detailed summary of all breaking changes. The below list should only be considered to be a summary.
Deprecations / Removals / API Changes:
initHighlighting()
and initHighlightingOnLoad()
deprecated. Use highlightAll()
.
highlightBlock(el)
deprecated. Use highlightElement(el)
before:highlightBlock
& after:highlightBlock
callbacks deprecated. Use equivalent highlightElement
callbacks.
highlight(languageName, code, ignoreIllegals, continuation)
signature deprecated. Use highlight(code, {language, ignoreIllegals})
.
highlight()
signature no longer supports continuation
argument.tabReplace
option removed. Consider a plugin.useBR
option removed. Consider a plugin or CSS.requireLanguage()
removed. Use getLanguage()
.
endSameAsBegin
mode key removed. Use hljs.END_SAME_AS_BEGIN
.
lexemes
mode key removed. Use keywords.$pattern
.
Security:
Themes:
schoolbook
has been updated to remove the lined background.github
updated to better match modern GitHub (#1616) Jan Pilzer
github-gist
has been removed in favor of github
Jan Pilzer
nnfx
updated for v11 xml styles and improved css supportLanguage Grammars:
Parser:
beginScope
and endScope
to allow separate scoping begin and end (#3159) Josh Goebel
endScope
now supports multi-class matchers as well (#3159) Josh Goebel
highlightElement
now always tags blocks with a consistent language-[name]
class Josh Goebel
span
tags now also always have the language-
prefix addedtitle.class.inherited
sub-scope support Josh Goebel
title.class
sub-scope support (#3078) Josh Goebel
title.function
sub-scope support (#3078) Josh Goebel
beforeMatch
compiler extension (#3078) Josh Goebel
cssSelector
configuration option (#3180) James Edington
Grammars:
.meta-keyword
=> .meta .keyword
(nested scopes) (#3167) Josh Goebel
.meta-string
=> .meta .string
(nested scopes) (#3167) Josh Goebel
actor
keyword (#3171) Bradley Mackey
@resultBuilder
attribute (#3151) Bradley Mackey
pde
alias (#3142) Dylan McBean
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
impl
(#3078) Josh Goebel
New Languages:
Theme Improvements:
builtin-name
CSS class (#3119) Josh Goebel
New Themes:
Dev Improvements:
See CHANGES.md.
See CHANGES.md.
This is a major release. As such it contains breaking changes which may require action from users. Please read VERSION_11_UPGRADE.md for a detailed summary of all breaking changes.
This release is:
Unless otherwise attributed items below are thanks to Josh Goebel (ref: #2558).
The below list should only be considered to be a high-level summary.
Deprecations / Removals / API Changes:
initHighlighting()
and initHighlightingOnLoad()
deprecated. Use highlightAll()
.
highlightBlock(el)
deprecated. Use highlightElement(el)
before:highlightBlock
& after:highlightBlock
callbacks deprecated. Use equivalent highlightElement
callbacks.
highlight(languageName, code, ignoreIllegals, continuation)
signature deprecated. Use highlight(code, {language, ignoreIllegals})
.
highlight()
signature no longer supports continuation
argument.tabReplace
option removed. Consider a plugin.useBR
option removed. Consider a plugin or CSS.requireLanguage()
removed. Use getLanguage()
.
endSameAsBegin
mode key removed. Use hljs.END_SAME_AS_BEGIN
.
lexemes
mode key removed. Use keywords.$pattern
.
Security:
Themes:
schoolbook
has been updated to remove the lined background.github
updated to better match modern GitHub (#1616) [Jan Pilzer][]Language Grammars:
Parser:
beginScope
and endScope
to allow separate scoping begin and end (#3159) Josh Goebel
endScope
now supports multi-class matchers as well (#3159) Josh Goebel
highlightElement
now always tags blocks with a consistent language-[name]
class Josh Goebel
span
tags now also always have the language-
prefix addedtitle.class.inherited
sub-scope support Josh Goebel
title.class
sub-scope support (#3078) Josh Goebel
title.function
sub-scope support (#3078) Josh Goebel
beforeMatch
compiler extension (#3078) Josh Goebel
Grammars:
@resultBuilder
attribute (#3151) Bradley Mackey
pde
alias (#3142) Dylan McBean
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
impl
(#3078) Josh Goebel
New Languages:
Theme Improvements:
builtin-name
CSS class (#3119) Josh Goebel
New Themes:
Dev Improvements:
This is a major alpha release. As such it contains breaking changes which may require action from users. Please read VERSION_11_UPGRADE.md for a detailed summary of all breaking changes.
Unless otherwise attributed items below are thanks to Josh Goebel (ref: #2558).
The below list should only be considered to be a high-level summary.
Deprecations / Removals / API Changes:
initHighlighting()
and initHighlightingOnLoad()
deprecated. Use highlightAll()
.
highlightBlock(el)
deprecated. Use highlightElement(el)
before:highlightBlock
& after:highlightBlock
callbacks deprecated. Use equivalent highlightElement
callbacks.
highlight(languageName, code, ignoreIllegals, continuation)
signature deprecated. Use highlight(code, {language, ignoreIllegals})
.
highlight()
signature no longer supports continuation
argument.tabReplace
option removed. Consider a plugin.useBR
option removed. Consider a plugin or CSS.requireLanguage()
removed. Use getLanguage()
.
endSameAsBegin
mode key removed. Use hljs.END_SAME_AS_BEGIN
.
lexemes
mode key removed. Use keywords.$pattern
.
Security:
Themes:
schoolbook
has been updated to remove the lined background.github
updated to better match modern GitHub (#1616) [Jan Pilzer][]Language Grammars:
Parser:
title.class
sub-scope support (#3078) Josh Goebel
title.function
sub-scope support (#3078) Josh Goebel
beforeMatch
compiler extension (#3078) Josh Goebel
Grammars:
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
function.title
=> title.function
(#3078) Josh Goebel
impl
(#3078) Josh Goebel
New Languages:
Theme Improvements:
builtin-name
CSS class (#3119) Josh Goebel
Dev Improvements:
This is a patch release. The only change is that deprecation messages are throttled and shown only once.
This .1 patch release fixes an issue with the TypeScript typing info in 10.7.0.
Parser:
unregisterLanguage
method (#3009) Antoine du Hamel
highlightAll()
now works if the library is lazy loaded Josh Goebel
New Languages:
Language grammar improvements:
defined?()
mis-highlighted as def
(#3025) Josh Goebel
#include <str>
blocks (#3041) Josh Goebel
#include <str>
blocks (#3041) Josh Goebel
trait
to class-like naming patterns (#2997) Ayesh
Stringable
, UnhandledMatchError
, and WeakMap
classes/interfaces (#2997) Ayesh
mixed
to list of keywords (#2997) Ayesh
kts
as an alias for Kotlin (#3021) Vaibhav Chanana
font-smoothing
to attributes list for CSS (#3027) AndyKIron
print
and exec
as a builtin (#1468) Samuel Colvin
Deprecations:
highlight(languageName, code, ignoreIllegals, continuation)
deprecated as of 10.7
code
and then accepts options as an objecthighlight(code, {language, ignoreIllegals})
continuation
is for internal use only and no longer supportedhighlightBlock(el)
deprecated as of 10.7.
highlightElement(el)
instead.before/after:highlightBlock
=> before/after:highlightElement
el
vs block
attribute