Version 11.5.1
Packaging:
- (chore) explicitly set
sideEffect
for css and scss files, fixes #3504
Syntax highlighting for the Web
class MyClass {
public static myValue: string;
constructor(init: string) {
this.myValue = init;
}
}
import fs = require("fs");
module MyModule {
export interface MyInterface extends Other {
myProperty: any;
}
}
declare magicNumber number;
myArray.forEach(() => { }); // fat arrow syntax
Version 11.5.1
Packaging:
sideEffect
for css and scss files, fixes #3504Version 11.5.0
Themes:
Tokyo-Night-dark
theme Henri VandersleyenTokyo-Night-light
theme Henri VandersleyenNew Grammars:
Grammars:
type
and variable.language
scopes Josh Goebel$pattern
(numbers allowed in command names) Martin Mattelmeta.prompt
scope for REPL prompts, etc Josh Goebel***Hello world***
without breaking Josh Goebelelse
Josh GoebelVersion 11.4.0
New Language:
Themes:
Default
is now much closer WCAG AA (contrast) (#3402) Josh GoebelDark
now meets WCAG AA (contrast) (#3402) Josh Goebelintellij-light
theme PegasisThese changes should be for the better and should not be super noticeable but if you're super picky about your colors you may want to intervene here or copy over the older themes from 11.3 or prior.
Grammars:
vector<<
template false positive (#3437) Josh Goebelnamespace
and use
highlighting (#3427) Josh Goebel$this
is a variable.language
now (#3427) Josh Goebel__COMPILER_HALT_OFFSET__
(#3427) Josh Goebelsealed
and non-sealed
keywords (#3386) Bradley MackeyCLASS_REFERENCE
(#3411) Josh Goebel!
(#3417) idleberg!
(#3420) idlebergcomment
macro catches more than it should (#3395)$
in symbol breaks highlightingregex
mode to regex literalpunctuation
mode for commas.jldoctest
alias (#3432) Fons van der PlasDeveloper Tools:
Themes:
Version 11.0.1
Version 11.0.0
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.
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 Pilzergithub-gist
has been removed in favor of github
Jan Pilzernnfx
updated for v11 xml styles and improved css supportLanguage Grammars:
Parser:
beginScope
and endScope
to allow separate scoping begin and end (#3159) Josh GoebelendScope
now supports multi-class matchers as well (#3159) Josh GoebelhighlightElement
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 Goebeltitle.class
sub-scope support (#3078) Josh Goebeltitle.function
sub-scope support (#3078) Josh GoebelbeforeMatch
compiler extension (#3078) Josh GoebelcssSelector
configuration option (#3180) James EdingtonGrammars:
.meta-keyword
=> .meta .keyword
(nested scopes) (#3167) Josh Goebel.meta-string
=> .meta .string
(nested scopes) (#3167) Josh Goebelactor
keyword (#3171) Bradley Mackey@resultBuilder
attribute (#3151) Bradley Mackeypde
alias (#3142) Dylan McBeanfunction.title
=> title.function
(#3078) Josh Goebelfunction.title
=> title.function
(#3078) Josh Goebelfunction.title
=> title.function
(#3078) Josh Goebelimpl
(#3078) Josh GoebelNew Languages:
Theme Improvements:
builtin-name
CSS class (#3119) Josh GoebelNew Themes:
Dev Improvements:
Version 10.7.2
This is a patch release. The only change is that deprecation messages are throttled and shown only once.
Version 10.7.1
Parser:
unregisterLanguage
method (#3009) Antoine du HamelhighlightAll()
now works if the library is lazy loaded Josh GoebelNew Languages:
Language grammar improvements:
defined?()
mis-highlighted as def
(#3025) Josh Goebel#include <str>
blocks (#3041) Josh Goebel#include <str>
blocks (#3041) Josh Goebeltrait
to class-like naming patterns (#2997) AyeshStringable
, UnhandledMatchError
, and WeakMap
classes/interfaces (#2997) Ayeshmixed
to list of keywords (#2997) Ayeshkts
as an alias for Kotlin (#3021) Vaibhav Chananafont-smoothing
to attributes list for CSS (#3027) AndyKIronprint
and exec
as a builtin (#1468) Samuel ColvinDeprecations:
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
attributeVersion 10.7.0
Parser:
unregisterLanguage
method (#3009) Antoine du HamelhighlightAll()
now works if the library is lazy loaded Josh GoebelNew Languages:
Language grammar improvements:
defined?()
mis-highlighted as def
(#3025) Josh Goebel#include <str>
blocks (#3041) Josh Goebel#include <str>
blocks (#3041) Josh Goebeltrait
to class-like naming patterns (#2997) AyeshStringable
, UnhandledMatchError
, and WeakMap
classes/interfaces (#2997) Ayeshmixed
to list of keywords (#2997) Ayeshkts
as an alias for Kotlin (#3021) Vaibhav Chananafont-smoothing
to attributes list for CSS (#3027) AndyKIronprint
and exec
as a builtin (#1468) Samuel ColvinDeprecations:
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
attributeVersion 10.6.0
New Languages:
Language grammar improvements:
Grammar Deprecations:
c-like
, though you should not be using it directly anyways.
c
and cpp
are now wholly unique grammars that will diverge over timeParser:
highlightAll()
API (#2962) Josh Goebel
initHighlighting()
and initHighlightingOnLoad()
beginKeyword
no longer bestows double relevance (#2953) Josh Goebelkeywords
to be an array of strings Josh Goebelmodes.MATCH_NOTHING_RE
that will never match
end
to hold a mode open (it must then be ended with endsParent
in one of it's children modes) Josh GoebelDeprecations:
initHighlighting()
and initHighlightingOnLoad()
deprecated.
highlightAll()
API instead.highlightAll
in v11.
@highlightjs