JavaScript syntax highlighter with language auto-detection and zero dependencies.
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
attributeNew 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 Goebel
keywords
to be an array of strings Josh Goebel
modes.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 Goebel
Deprecations:
initHighlighting()
and initHighlightingOnLoad()
deprecated.
highlightAll()
API instead.highlightAll
in v11.What's New
Build:
cdn-assets
Josh Goebel
:common
) Josh Goebel
Parser:
match
as sugar for simple begin
only matches (#2834) Josh Goebel
illegal
to also be an array of regex (#2834) Josh Goebel
compilerExtensions
allows grammers to influence mode compilation (#2834) Josh Goebel
New Languages:
Language grammar improvements:
make
as an alias (#2883) tripleee
[]
for argument lists (#2913) Josh Goebel
REM
comments and fixes '''
doctags (#2875) (#2851)
Enable
, Disable
, and Then
keywordsRecent Deprecations:
<pre>
blocks will no longer be magically merged back into the
highlighted code's HTML result - it will instead be silently removed.tabReplace
option deprecated. (#2873) Josh Goebel
tab-size
property, or simply pre-process the
text yourself before rendering the initial HTMLuseBR
option deprecated. (#2559) Josh Goebel
<pre>
tagwhite-space: pre;
requireLanguage
API is deprecated, will be removed in v11.0.
getLanguage
(with custom error handling) or built-time dependencies.Security fixes:
Very grateful to Michael Schmidt for all the help.
A largish release with many improvements and fixes from quite a few different contributors. Enjoy!
Deprecations:
requireLanguage
is deprecated.
getLanguage
(with custom error handling) or built-time dependencies.Parser:
beginKeywords
support (#2813) Josh Goebel
classNameAliases
for more complex grammars Josh Goebel
New Languages:
node-repl
for Node.js REPL sessions (#2792) Marat Nagayev
Language Improvements:
~
(#2859) Guillaume Grossetie
\
(#2861) Guillaume Grossetie
\[Gamma]
#
Marcus Ortiz
some
keyword Marcus Ortiz
@main
attribute Marcus Ortiz
Dev Improvements:
New themes:
Tiny tiny release, just to fix the website incorrectly not listing Javascript in the list of languages you could choose for a custom build. NPM and CDN build should not have been affected so 10.3.1 is effectively the same as 10.3.2 for those builds.
If you made a custom build from the website with 10.3 or 10.3.1 you may want to check and make sure it includes Javascript, and if not, build it again.
Prior version let some look-behind regex sneak in, which does not work yet on Safari. This release removes those incompatible regexes.
Fixes:
Lots of large and small improvements to grammars including a major rewrite of our LaTeX grammar. See CHANGES.md for full list. Thanks for the interest from StackOverflow and Octoberfest!
useBR
option deprecated and will be removed in v11.0.Thanks to everyone who contributed to this release:
Parser Engine:
Parser Engine:
New themes:
Deprecations:
fixMarkup
is now deprecated and will be removed in v11.0. (#2534) Josh Goebel
Big picture:
Language Improvements:
init
and record
keywords for C# 9.0 (#2660) Youssef Victor
arguments
keyword and fix enumeration
keyword (#2619) Andrew Janke
getLanguage
(#2636) night
enum
, which will identify as a class
now (#2643) ezksd