@ng-doc/utils 17.6.3 → 17.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SECURITY.md DELETED
@@ -1,19 +0,0 @@
1
- # Security Policy
2
-
3
- Due to both time and resource constrains the Highlight.js core team fully supports only the current major/minor release of the library. Prior major releases may be supported for a short time after new major releases are issued. Problems with minor releases are often resolved by upgrading to the most recent minor release.
4
-
5
- ### Release Status
6
-
7
- | Version | Support | Status |
8
- | :-----: | :-: | :------ |
9
- | 11.x | :white_check_mark: | The 11.x series recieves regular updates, new features & security fixes. |
10
- | 10.7.x | :x: | No longer supported. <br>See [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_11_UPGRADE.md).|
11
- | <= 10.4.0 | :x: | Known vulnerabities. |
12
- | <= 9.18.5 | :x: | Known vulnerabities. [EOL](https://github.com/highlightjs/highlight.js/issues/2877) |
13
- | 7.x, 8.x | :x: | Obsolete. Known vulnerabities. |
14
-
15
-
16
- ### Reporting a Vulnerability
17
-
18
- Many vulnerabilities can simply be reported (and tracked) via our [GitHub issues](https://github.com/highlightjs/highlight.js/issues). If you feel your issue is more sensitive than that you can always reach us via email: [security@highlightjs.org](mailto:security@highlightjs.org)
19
-
@@ -1,252 +0,0 @@
1
- # Supported Languages
2
-
3
- The table below shows the full list of languages (and corresponding classes/aliases) supported by Highlight.js. Languages that list a **Package** below are 3rd party languages and are not bundled with the core library. You can find their repositories by following the links.
4
-
5
- **Note:** The languages available will depend on how you've built or are included the library in your app. For example our default minified web build includes only ~40 popular languages. See [Getting the Library][1] and [Importing the Library][2] in the README for examples of how to load additional/specific languages.
6
-
7
- <!-- LANGLIST -->
8
- | Language | Aliases | Package |
9
- | :-----------------------| :--------------------- | :------ |
10
- | 1C | 1c | |
11
- | 4D | 4d |[highlightjs-4d](https://github.com/highlightjs/highlightjs-4d) |
12
- | ABAP | sap-abap, abap |[highlight-sap-abap](https://github.com/highlightjs/highlightjs-sap-abap) |
13
- | ABNF | abnf | |
14
- | Access logs | accesslog | |
15
- | Ada | ada | |
16
- | Apex | apex | [highlightjs-apex](https://github.com/highlightjs/highlightjs-apex/) |
17
- | Arduino (C++ w/Arduino libs) | arduino, ino | |
18
- | ARM assembler | armasm, arm | |
19
- | AVR assembler | avrasm | |
20
- | ActionScript | actionscript, as | |
21
- | Alan IF | alan, i | [highlightjs-alan](https://github.com/highlightjs/highlightjs-alan) |
22
- | Alan | ln | [highlightjs-alan](https://github.com/alantech/highlightjs-alan) |
23
- | AngelScript | angelscript, asc | |
24
- | Apache | apache, apacheconf | |
25
- | AppleScript | applescript, osascript | |
26
- | Arcade | arcade | |
27
- | AsciiDoc | asciidoc, adoc | |
28
- | AspectJ | aspectj | |
29
- | AutoHotkey | autohotkey | |
30
- | AutoIt | autoit | |
31
- | Awk | awk, mawk, nawk, gawk | |
32
- | Bash | bash, sh, zsh | |
33
- | Basic | basic | |
34
- | BBCode | bbcode | [highlightjs-bbcode](https://github.com/RedGuy12/highlightjs-bbcode) |
35
- | Blade (Laravel) | blade | [highlightjs-blade](https://github.com/miken32/highlightjs-blade) |
36
- | BNF | bnf | |
37
- | Brainfuck | brainfuck, bf | |
38
- | C# | csharp, cs | |
39
- | C | c, h | |
40
- | C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | |
41
- | C/AL | cal | |
42
- | Cache Object Script | cos, cls | |
43
- | CMake | cmake, cmake.in | |
44
- | COBOL | cobol, standard-cobol | [highlightjs-cobol](https://github.com/otterkit/highlightjs-cobol) |
45
- | Coq | coq | |
46
- | CSP | csp | |
47
- | CSS | css | |
48
- | Cap’n Proto | capnproto, capnp | |
49
- | Chaos | chaos, kaos | [highlightjs-chaos](https://github.com/chaos-lang/highlightjs-chaos) |
50
- | Chapel | chapel, chpl | [highlightjs-chapel](https://github.com/chapel-lang/highlightjs-chapel) |
51
- | Cisco CLI | cisco | [highlightjs-cisco-cli](https://github.com/BMatheas/highlightjs-cisco-cli) |
52
- | Clojure | clojure, clj | |
53
- | CoffeeScript | coffeescript, coffee, cson, iced | |
54
- | CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) |
55
- | Crmsh | crmsh, crm, pcmk | |
56
- | Crystal | crystal, cr | |
57
- | cURL | curl | [highlightjs-curl](https://github.com/highlightjs/highlightjs-curl) |
58
- | Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) |
59
- | D | d | |
60
- | Dafny | dafny | [highlightjs-dafny](https://github.com/ConsenSys/highlightjs-dafny)|
61
- | Dart | dart | |
62
- | Delphi | dpr, dfm, pas, pascal | |
63
- | Diff | diff, patch | |
64
- | Django | django, jinja | |
65
- | DNS Zone file | dns, zone, bind | |
66
- | Dockerfile | dockerfile, docker | |
67
- | DOS | dos, bat, cmd | |
68
- | dsconfig | dsconfig | |
69
- | DTS (Device Tree) | dts | |
70
- | Dust | dust, dst | |
71
- | Dylan | dylan | [highlightjs-dylan](https://github.com/highlightjs/highlightjs-dylan) |
72
- | EBNF | ebnf | |
73
- | Elixir | elixir | |
74
- | Elm | elm | |
75
- | Erlang | erlang, erl | |
76
- | Excel | excel, xls, xlsx | |
77
- | Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) |
78
- | F# | fsharp, fs | |
79
- | FIX | fix | |
80
- | Flix | flix | [highlightjs-flix](https://github.com/flix/highlightjs-flix) |
81
- | Fortran | fortran, f90, f95 | |
82
- | FunC | func | [highlightjs-func](https://github.com/highlightjs/highlightjs-func) |
83
- | G-Code | gcode, nc | |
84
- | Gams | gams, gms | |
85
- | GAUSS | gauss, gss | |
86
- | GDScript | godot, gdscript | [highlightjs-gdscript](https://github.com/highlightjs/highlightjs-gdscript) |
87
- | Gherkin | gherkin | |
88
- | Glimmer and EmberJS | hbs, glimmer, html.hbs, html.handlebars, htmlbars | [highlightjs-glimmer](https://github.com/NullVoxPopuli/highlightjs-glimmer) |
89
- | GN for Ninja | gn, gni | [highlightjs-GN](https://github.com/highlightjs/highlightjs-GN) |
90
- | Go | go, golang | |
91
- | Grammatical Framework | gf | [highlightjs-gf](https://github.com/johnjcamilleri/highlightjs-gf) |
92
- | Golo | golo, gololang | |
93
- | Gradle | gradle | |
94
- | GraphQL | graphql | |
95
- | Groovy | groovy | |
96
- | GSQL | gsql | [highlightjs-gsql](https://github.com/DanBarkus/highlightjs-gsql) |
97
- | HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | |
98
- | HTTP | http, https | |
99
- | Haml | haml | |
100
- | Handlebars | handlebars, hbs, html.hbs, html.handlebars | |
101
- | Haskell | haskell, hs | |
102
- | Haxe | haxe, hx | |
103
- | High-level shader language| hlsl | [highlightjs-hlsl](https://github.com/highlightjs/highlightjs-hlsl) |
104
- | Hy | hy, hylang | |
105
- | Ini, TOML | ini, toml | |
106
- | Inform7 | inform7, i7 | |
107
- | IRPF90 | irpf90 | |
108
- | JSON | json | |
109
- | Java | java, jsp | |
110
- | JavaScript | javascript, js, jsx | |
111
- | Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) |
112
- | Julia | julia, julia-repl | |
113
- | Kotlin | kotlin, kt | |
114
- | LaTeX | tex | |
115
- | Leaf | leaf | |
116
- | Lean | lean | [highlightjs-lean](https://github.com/leanprover-community/highlightjs-lean) |
117
- | Lasso | lasso, ls, lassoscript | |
118
- | Less | less | |
119
- | LDIF | ldif | |
120
- | Lisp | lisp | |
121
- | LiveCode Server | livecodeserver | |
122
- | LiveScript | livescript, ls | |
123
- | LookML | lookml | [highlightjs-lookml](https://github.com/spectacles-ci/highlightjs-lookml) |
124
- | Lua | lua | |
125
- | Macaulay2 | macaulay2 | [highlightjs-macaulay2](https://github.com/d-torrance/highlightjs-macaulay2) |
126
- | Makefile | makefile, mk, mak, make | |
127
- | Markdown | markdown, md, mkdown, mkd | |
128
- | Mathematica | mathematica, mma, wl | |
129
- | Matlab | matlab | |
130
- | Maxima | maxima | |
131
- | Maya Embedded Language | mel | |
132
- | Mercury | mercury | |
133
- | mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) |
134
- | Mizar | mizar | |
135
- | MKB | mkb | [highlightjs-mkb](https://github.com/Dereavy/highlightjs-mkb) |
136
- | MLIR | mlir | [highlightjs-mlir](https://github.com/highlightjs/highlightjs-mlir) |
137
- | Mojolicious | mojolicious | |
138
- | Monkey | monkey | |
139
- | Moonscript | moonscript, moon | |
140
- | N1QL | n1ql | |
141
- | NSIS | nsis | |
142
- | Never | never | [highlightjs-never](https://github.com/never-lang/highlightjs-never) |
143
- | Nginx | nginx, nginxconf | |
144
- | Nim | nim, nimrod | |
145
- | Nix | nix | |
146
- | Oak | oak | [highlightjs-oak](https://github.com/timlabs/highlightjs-oak) |
147
- | Object Constraint Language | ocl | [highlightjs-ocl](https://github.com/nhomble/highlightjs-ocl) |
148
- | OCaml | ocaml, ml | |
149
- | Objective C | objectivec, mm, objc, obj-c, obj-c++, objective-c++ | |
150
- | OpenGL Shading Language | glsl | |
151
- | OpenSCAD | openscad, scad | |
152
- | Oracle Rules Language | ruleslanguage | |
153
- | Oxygene | oxygene | |
154
- | PF | pf, pf.conf | |
155
- | PHP | php | |
156
- | Papyrus | papyrus, psc |[highlightjs-papyrus](https://github.com/Pickysaurus/highlightjs-papyrus) |
157
- | Parser3 | parser3 | |
158
- | Perl | perl, pl, pm | |
159
- | Pine Script | pine, pinescript | [highlightjs-pine](https://github.com/jeyllani/highlightjs-pine) |
160
- | Plaintext | plaintext, txt, text | |
161
- | Pony | pony | |
162
- | PostgreSQL & PL/pgSQL | pgsql, postgres, postgresql | |
163
- | PowerShell | powershell, ps, ps1 | |
164
- | Processing | processing | |
165
- | Prolog | prolog | |
166
- | Properties | properties | |
167
- | Protocol Buffers | protobuf | |
168
- | Puppet | puppet, pp | |
169
- | Python | python, py, gyp | |
170
- | Python profiler results | profile | |
171
- | Python REPL | python-repl, pycon | |
172
- | Q# | qsharp | [highlightjs-qsharp](https://github.com/fedonman/highlightjs-qsharp) |
173
- | Q | k, kdb | |
174
- | QML | qml | |
175
- | R | r | |
176
- | Razor CSHTML | cshtml, razor, razor-cshtml | [highlightjs-cshtml-razor](https://github.com/highlightjs/highlightjs-cshtml-razor) |
177
- | ReasonML | reasonml, re | |
178
- | Rebol & Red | redbol, rebol, red, red-system | [highlightjs-redbol](https://github.com/oldes/highlightjs-redbol) |
179
- | RenderMan RIB | rib | |
180
- | RenderMan RSL | rsl | |
181
- | RiScript | risc, riscript | [highlightjs-riscript](https://github.com/highlightjs/highlightjs-riscript) |
182
- | Roboconf | graph, instances | |
183
- | Robot Framework | robot, rf | [highlightjs-robot](https://github.com/highlightjs/highlightjs-robot) |
184
- | RPM spec files | rpm-specfile, rpm, spec, rpm-spec, specfile | [highlightjs-rpm-specfile](https://github.com/highlightjs/highlightjs-rpm-specfile) |
185
- | Ruby | ruby, rb, gemspec, podspec, thor, irb | |
186
- | Rust | rust, rs | |
187
- | RVT Script | rvt, rvt-script | [highlightjs-rvt-script](https://github.com/Sopitive/highlightjs-rvt-script) |
188
- | SAS | SAS, sas | |
189
- | SCSS | scss | |
190
- | SQL | sql | |
191
- | STEP Part 21 | p21, step, stp | |
192
- | Scala | scala | |
193
- | Scheme | scheme | |
194
- | Scilab | scilab, sci | |
195
- | Shape Expressions | shexc | [highlightjs-shexc](https://github.com/highlightjs/highlightjs-shexc) |
196
- | Shell | shell, console | |
197
- | Smali | smali | |
198
- | Smalltalk | smalltalk, st | |
199
- | SML | sml, ml | |
200
- | Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) |
201
- | Splunk SPL | spl | [highlightjs-spl](https://github.com/swsoyee/highlightjs-spl) |
202
- | Stan | stan, stanfuncs | |
203
- | Stata | stata | |
204
- | Structured Text | iecst, scl, stl, structured-text | [highlightjs-structured-text](https://github.com/highlightjs/highlightjs-structured-text) |
205
- | Stylus | stylus, styl | |
206
- | SubUnit | subunit | |
207
- | Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) |
208
- | Svelte | svelte | [highlightjs-svelte](https://github.com/AlexxNB/highlightjs-svelte) |
209
- | Swift | swift | |
210
- | Tcl | tcl, tk | |
211
- | Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) |
212
- | Test Anything Protocol | tap | |
213
- | Thrift | thrift | |
214
- | Toit | toit | [toit-highlight](https://github.com/snxx-lppxx/toit-highlight) |
215
- | TP | tp | |
216
- | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) |
217
- | Twig | twig, craftcms | |
218
- | TypeScript | typescript, ts, tsx | |
219
- | Unicorn Rails log | unicorn-rails-log | [highlightjs-unicorn-rails-log](https://github.com/sweetppro/highlightjs-unicorn-rails-log) |
220
- | VB.Net | vbnet, vb | |
221
- | VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) |
222
- | VBScript | vbscript, vbs | |
223
- | VHDL | vhdl | |
224
- | Vala | vala | |
225
- | Verilog | verilog, v | |
226
- | Vim Script | vim | |
227
- | X# | xsharp, xs, prg | [highlightjs-xsharp](https://github.com/InfomindsAg/highlightjs-xsharp) |
228
- | X++ | axapta, x++ | |
229
- | x86 Assembly | x86asm | |
230
- | XL | xl, tao | |
231
- | XQuery | xquery, xpath, xq | |
232
- | YAML | yml, yaml | |
233
- | ZenScript | zenscript, zs |[highlightjs-zenscript](https://github.com/highlightjs/highlightjs-zenscript) |
234
- | Zephir | zephir, zep | |
235
- <!-- LANGLIST_END -->
236
-
237
- <!-- document it until we can fix it -->
238
- ## Alias Overlap
239
-
240
- If you are using either of these languages at the same time please be sure to
241
- use the full name and not the alias to avoid any ambiguity.
242
-
243
- | Language | Overlap |
244
- | :-----------------------| :--------------------- |
245
- | SML | ml |
246
- | OCaml | ml |
247
- | Lasso | ls |
248
- | LiveScript | ls |
249
-
250
-
251
- [1]: https://github.com/highlightjs/highlight.js#getting-the-library
252
- [2]: https://github.com/highlightjs/highlight.js#importing-the-library
@@ -1,58 +0,0 @@
1
- # Upgrading to Version 10.0
2
-
3
- Welcome to version 10.0. This a major release and therefore will contain breaking changes.
4
-
5
- ## Breaking Changes
6
-
7
- Our normal minor releases try to never break anything, holding all breaking changes for major releases.
8
- We tried to squeeze in as many as we could this time so that after 10.0 ships we'll be back to quiet sailing for a while before we need to push version 11. That said, we're very conservative about what we consider a breaking change.
9
-
10
- *IE, if there it could possibly break things for anyone, it's typically a breaking change.* The fact is a vast majority of users should upgrade and probably not notice any changes at all.
11
-
12
- See [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md) for a comprehensive list of breaking changes, but here is a summary... if you use:
13
-
14
- ### Core highlight.js lib on the client (with no extra CDN languages)
15
-
16
- Just keep doing that.
17
-
18
- - If you're using `darkula.css`, you'll need to change that to `darcula.css`
19
- - The minified distributable has changed from `.pack.js` to `.min.js`, update your name when you update your URL.
20
- - If your users have very old browsers, they may no longer be supported (no more IE11, etc.). (We're using ES2015 code now.)
21
- - `nohighlight` or `no-highlight` are the only two CSS classes that will SKIP highlighting completely. `*text*` and `*plain*` no longer will do this.
22
-
23
- ### Core highlight.js lib on the client (plus additional CDN languages)
24
-
25
- Quite a few grammars have been renamed. Ex: `nimrod.js` is now `nim.js`.
26
-
27
- - Check the renamed grammars to see if you might need to update your links.
28
- - Be aware that you can't use version 9 CDN JS files anymore, they aren't compatible.
29
- - Plus read the above list of items.
30
-
31
- ### highlight.js on the server (via NPM) and only use the public API
32
-
33
- If you're just pulling in the FULL library (`require('./highlight.js')`) just keep doing that. You might not need to change anything.
34
-
35
- - If you're manually loading a smaller set of languages and using `registerLanguage` make sure you check out all the renamed grammars and dependency changes.
36
- - Read the client-side lists above also.
37
-
38
- ### highlight.js on the server (via NPM) with a custom integration
39
-
40
- Read the complete breaking changes list carefully.
41
-
42
- - Read the client-side lists above also.
43
-
44
- ### highlight.js lib on the client, with source directly from our GitHub repo
45
-
46
- That will no longer work. The source needs to be built to work properly and cannot be used "raw" unless you've also setup your own build pipeline (rollup, etc.). Fetch a static build from the CDN, the [cdn-release repo](https://github.com/highlightjs/cdn-release) or use the new [`highlightjs-dist`]() NPM package.
47
-
48
- ### highlight.js source code directly from our GitHub repo with a custom integration
49
-
50
- All bets are off, since we only try to guarantee stability of our NPM and CDN builds and the public API. Read all the breaking changes and perhaps skim the commit history.
51
-
52
- - We're using ES6 modules now.
53
- - We're using an entirely new build system.
54
- - The source will likely become more and more modular during the 10.0 timeline.
55
-
56
- ## Enjoy and good luck.
57
-
58
- As always if you have any questions or issues, jump on the [Github Issues](https://github.com/highlightjs/highlight.js/issues).
@@ -1,203 +0,0 @@
1
- # Upgrading to Highlight.js v11.0
2
-
3
- - [Overview of Breaking Changes](#overview-of-breaking-changes)
4
- - [Built-in set of "Common" Languages](#built-in-set-of-common-languages)
5
- - [Language Files](#language-files)
6
- - [Language Aliases](#language-aliases)
7
- - [Styles and CSS](#styles-and-css)
8
- - [Grammar Scopes](#grammar-scopes)
9
- - [Behavioral changes](#behavioral-changes)
10
- - [API changes](#api-changes)
11
- - [Changes to Result Data](#changes-to-result-data)
12
- - [Feature Removal](#feature-removal)
13
- - [Small Things](#small-things)
14
- - [Upgrading from Version 9.x](#upgrading-from-version-9x)
15
-
16
-
17
- ## Overview of Breaking Changes
18
-
19
- Welcome to version 11.0. This a major release and therefore contains breaking changes. Below is a complete list of those such changes.
20
-
21
-
22
- ### Built-in set of "Common" Languages
23
-
24
- The default `highlight.min.js` build **removes** a few less popular grammars:
25
-
26
- - apache
27
- - http
28
- - nginx
29
- - properties
30
- - coffeescript
31
-
32
- If you need any of these, you can always create a custom build.
33
-
34
- Ref: https://github.com/highlightjs/highlight.js/issues/2848
35
-
36
-
37
- ### Language Files
38
-
39
- This would matter if you are requiring any of these files directly (via Node.js or CDN).
40
-
41
- - `htmlbars` has been removed. Use `handlebars` instead.
42
- - `c-like` has been removed. Use `c`, `cpp`, or `arduino`.
43
- - `sql_more` has been removed. Use `sql` instead or a more specific 3rd party grammar.
44
-
45
-
46
- ### Language Aliases
47
-
48
- This would matter if you are using these aliases.
49
-
50
- - `php3`,`php4`,`php5`, `php6`, `php7`, and `php8` have been removed. Use `php` instead.
51
- - `zsh` has been removed. Use `sh` or `bash` instead.
52
- - `freepascal`, `lazarus`, `lpr`, and `lpm` removed. Use `delphi` instead.
53
-
54
- You can of course re-register any of these aliases easily if necessary. For example to restore the PHP aliases:
55
-
56
- ```js
57
- hljs.registerAliases(["php3","php4","php5","php6","php7","php8"],{ languageName: "php" })
58
- ```
59
-
60
- ### Styles and CSS
61
-
62
- - The default padding on `.hljs` element has been increased and is now `1em` (it was `0.5em` previously). If your design depends on the smaller spacing you may need to update your CSS to override.
63
- - `schoolbook` no longer has a custom lined background, it is solid color now. The old image and CSS can be found in the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles) if you wish to manually copy it into your project.
64
- - `github` includes significant changes to more properly match modern GitHub syntax highlighting. If you desire the old theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles).
65
- - `github-gist` has been removed in favor of `github` as GitHub and GitHub Gist have converged. If you desire the theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles).
66
- - The `.hljs` CSS selector is now further scoped. It now targets `code.hljs` (inline code) and `pre code.hljs` (code blocks). If you are using a different element you may need to update your CSS to reapply some styling.
67
- - All [Base16 themes](https://github.com/highlightjs/base16-highlightjs) now live in the `styles/base16` directory - this means some CSS files have moved. Please confirm themes you use reference the new locations.
68
-
69
-
70
- #### Grammar Scopes
71
-
72
- - `.meta-string` removed/deprecated. Use `.meta .string` (a nested scope) instead. See [meta-keyword][].
73
- - `.meta-keyword` removed/deprecated. Use `.meta .keyword` (a nested scope) instead. See [meta-keyword][].
74
-
75
- ### Behavioral changes
76
-
77
- - `after:highlightElement` plugin callback is now fired *after* the DOM has been updated, not before.
78
-
79
- #### API changes
80
-
81
- - The option `ignoreIllegals` is now `true` by default (for `highlight()`). Previously it was `false`.
82
- - The `highlight(language,code, ...args)` API no longer accepts `continuation` as a 4th argument.
83
- - The `highlight(language,code, ...args)` API is deprecated (to be removed in 12.0).
84
-
85
- The new call signature is `highlight(code, {options})`. ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight))
86
-
87
- Code using the old API:
88
-
89
- ```js
90
- // highlight(language, code, ignoreIllegals, continuation)
91
- highlight("javascript", "var a = 5;", true)
92
- ```
93
- ...would be upgraded to the newer API as follows:
94
-
95
- ```js
96
- // highlight(code, {language, ignoreIllegals})
97
- highlight("var a = 5;", {language: "javascript", ignoreIllegals: true})
98
- ```
99
-
100
- The new API purposely does not support `continuation` as this is only intended for internal library usage.
101
-
102
- - `initHighlighting()` is deprecated (to be removed in 12.0).
103
- - `initHighlightingOnLoad()` is deprecated (to be removed in 12.0).
104
-
105
- **Use `highlightAll()` instead.** ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight-all)) The old functions are now simply aliases of `highlightAll()`. The new function may be called before or after the DOM is loaded and should do the correct thing in all cases, replacing the need for the previous individual functions.
106
-
107
- Note: `highlightAll()` does not guard against calling itself repeatedly as the previous functions did. Your code should be careful to avoid doing this.
108
-
109
- - `highlightBlock()` is deprecated (to be removed in 12.0).
110
-
111
- **Use `highlightElement()` instead.** ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight-element)) This is merely a naming change.
112
-
113
- Note: The object literal passed to the `before:highlightElement` callback now passes the element in the `el` key vs the `block` key.
114
-
115
- ##### Changes to Result Data
116
-
117
- - `highlightAuto()`'s `second_best` key has been renamed to `secondBest`
118
- - `highlightElement()`'s result now no longer includes a `re` key. Use the `relevance` key now.
119
- - `highlight()` renames some result keys to more clearly mark them as private: `_top`, `_emitter`, and `_illegalBy`. You should not depend on these keys as they are subject to change at any time.
120
- - The `relevance` key returned by `highlight()` is no longer guaranteed to be an even integer.
121
- - `highlightElement` now always tags blocks with a consistent `language-[name]` class
122
-
123
- This behavior was inconsistent before. Sometimes `[name]` class would be added, sometimes the alias name would be added, something no class would be added. now `language-[name]` is always added. This also affects sublanguage `span` tags which now also include the `language-` prefix.
124
-
125
- #### Feature Removal
126
-
127
- - HTML auto-passthru is now no longer included in core. Use a plugin instead. For a possible plugin please see [#2889](https://github.com/highlightjs/highlight.js/issues/2889).
128
-
129
- An example:
130
-
131
- ```html
132
- <pre><code class="lang-js">
133
- var a = 4;
134
- <span class="yellow">var a = 4;</span>
135
- </code></pre>
136
- ```
137
-
138
- Unescaped HTML like this will now be ignored (stripped before highlighting) and a warning will be logged to the console. All HTML to be highlighted should be properly escaped to avoid potential HTML/JS injection attacks.
139
-
140
- - `fixMarkup` has been removed.
141
-
142
- This function was deprecated in v10.2. It is not our goal to provide random string utilities. You may need to provide your own replacement [Ref: #2534](https://github.com/highlightjs/highlight.js/issues/2634)
143
-
144
- - `CSS_NUMBER_MODE` has been removed.
145
-
146
- This rule was too broad for bring inclusion in core and has been removed.
147
-
148
- - `lexemes` mode attribute has been removed.
149
-
150
- Use the new `keywords.$pattern` instead.
151
-
152
- Before:
153
-
154
- ```js
155
- {
156
- keywords: "do.it start.now begin.later end.immediately"
157
- lexemes: /[a-z.]+/
158
- }
159
- ```
160
-
161
- After:
162
-
163
- ```js
164
- {
165
- keywords: {
166
- $pattern: /[a-z.]+/
167
- keyword: "do.it start.now begin.later end.immediately",
168
- }
169
- }
170
- ```
171
-
172
- This may required converting your `keywords` key into an object if it's not already (as shown above).
173
-
174
- - `endSameAsBegin` mode attribute has been removed.
175
-
176
- Use the new `END_SAME_AS_BEGIN` mode rule/function instead.
177
-
178
- - `useBR` configuration has been removed.
179
-
180
- This configuration option was deprecated in v10.1. Use a plugin or preferably simply CSS `white-space: pre`. [Ref: #2559](https://github.com/highlightjs/highlight.js/issues/2559)
181
-
182
-
183
- - `tabReplace` configuration has been removed.
184
-
185
- This configuration option was deprecated in v10.5. Use a plugin or pre-render content instead with desired spacing. [Ref: #2874](https://github.com/highlightjs/highlight.js/issues/2874)
186
-
187
-
188
-
189
-
190
-
191
- ### Small Things
192
-
193
- - The `regex` utility `join` has been renamed to `_eitherRewriteBackreferences` (this has always been intended for internal use only)
194
-
195
- ### Upgrading from Version 9.x
196
-
197
- If you're upgrading all the way from version 9 it may still be helpful to review all the breaking changes in version 10 as well:
198
-
199
- - [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_UPGRADE.md)
200
- - [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md)
201
-
202
-
203
- [meta-keyword]: https://github.com/highlightjs/highlight.js/pull/3167