Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master #3

Merged
merged 64 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3875088
(docs) Add Chaos to supported languages (#2510)
mertyildiran Apr 25, 2020
f6813cc
fix(parser) fixes sublanguage with no rule matches (#2506)
joshgoebel Apr 26, 2020
705f49b
(chore) Add ESLint config and clean up the major stuff (#2503)
joshgoebel Apr 26, 2020
f86d6a9
(docs) Add Visual Basic for Applications (VBA) to supported languages…
dullin Apr 27, 2020
7502e42
(yaml) improve tag support; add verbatim tags (#2487)
pplantinga Apr 27, 2020
0afd0d3
fix(javascript/typescript): lambda with parens in parameters fails (#…
joshgoebel Apr 27, 2020
58d9113
enh(cpp): Improve highlighting of unterminated raw strings
davidben Nov 8, 2019
1998ddf
(chore) C-like uses the new END_SAME_AS_BEGIN mode
joshgoebel Mar 3, 2020
95abfe0
(chore) Ruby uses END_SAME_AS_BEGIN mode/rule
joshgoebel Mar 3, 2020
07450a6
(parser) make END_SAME_AS_BEGIN a function helper
joshgoebel Mar 12, 2020
629de19
(pgsql) add test for $$ quoting existing behavior
joshgoebel Mar 12, 2020
a4f1f20
(chore) pgsql uses END_SAME_AS_BEGIN mode/rule now also
joshgoebel Mar 12, 2020
d4b047b
(docs) rename to `mode_reference`; docs for callbacks
joshgoebel Mar 12, 2020
ba2e65e
prevented setter keyword conflicting with setTimeout|setInterval and …
qWici Apr 28, 2020
e63d5d7
(docs) add TLDR instructions for building and testing
joshgoebel Apr 28, 2020
5f1fbf1
(dev) improve developer tool UI
joshgoebel Apr 29, 2020
b984c7b
(parser) Build common EMCAscript foundation
joshgoebel Apr 28, 2020
a23f19e
(parser) Adds SHEBANG mode
joshgoebel Apr 28, 2020
d98cd4f
(yaml) Add support for inline sequences and mappings (#2513)
pplantinga Apr 30, 2020
e8624cc
[enh] Add `OPTIMIZE:` and `HACK:` to comment doctags
joshgoebel Apr 30, 2020
8f5290e
(build) browser build is CommonJS and IIFE, no more AMD (#2511)
joshgoebel May 3, 2020
acbbac8
fix(parser) Fix freezing issue with illegal 0 width matches (#2524)
joshgoebel May 3, 2020
b31cb98
(docs) added unicorn-rails-log as an 3rd-party language (#2528)
sweetppro May 4, 2020
33d3afe
(docs) fix supported languages link: it moved again! (#2533)
noraj May 5, 2020
9e4f2dc
fix(ts/js) use identifier to match potential keywords (#2519)
joshgoebel May 7, 2020
5c125b9
fix(javascript) fix regex inside parens after a non-regex (#2531)
joshgoebel May 7, 2020
2fafd0e
(parser) Add hljs.registerAlias() public API (#2540)
taufik-nurrohman May 8, 2020
04e4991
enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538)
Reqwey May 8, 2020
8c74229
(fix) `fixMarkup` would rarely destroy markup when `useBR` was enable…
joshgoebel May 8, 2020
527086f
enh(cpp) Recognize `priority_queue`, `pair` as containers (#2541)
Reqwey May 8, 2020
a3be151
chore: rename `registerAlias` to `registerAliases`
joshgoebel May 8, 2020
544ed68
(swift) @objcMembers not completely highlighted (#2543)
nicked May 10, 2020
02fd993
(docs) add OCL to list of supported languages (#2547)
nhomble May 11, 2020
a34f2d4
(docs) Add Svelte to list of supported languages (#2549)
ryanditjia May 12, 2020
f64993f
enh(dart) Add `late` and `required` keywords, and `Never` built-in ty…
srawlins May 12, 2020
b50fa49
enh(erlang) add support for underscore separators in numeric literals…
seriyps May 14, 2020
c5cdc1c
(docs) add Jolie to Supported Languages (#2556)
xiroV May 14, 2020
c836e3a
(parser/docs) Add jsdoc annotations and TypeScript type file (#2517)
joshgoebel May 15, 2020
63f367c
(parser) highlightBlock result key `re` => `relevance` (#2553)
joshgoebel May 15, 2020
e9e7b44
enh(handlebars) Support for sub-expressions, path-expressions, hashes…
nknapp May 19, 2020
278a610
fix(typescript) Add missing `readonly` keyword (#2562)
Unnvaldr May 19, 2020
02bdae3
(docs) Mention `c` is a possible class for C (#2577)
DerekNonGeneric May 22, 2020
c6f2995
fix(groovy) strings are not allowed inside ternary clauses (#2565)
joshgoebel May 22, 2020
cc2dc8b
Update @typescript-eslint/parser to the latest version 🚀 (#2575)
greenkeeper[bot] May 22, 2020
a6f0a34
Update @typescript-eslint/eslint-plugin to the latest version 🚀 (#2576)
greenkeeper[bot] May 22, 2020
3e9c1b1
(parser) properly escape ' and " in HTML output (#2564)
joshgoebel May 22, 2020
3ff5169
(docs) add changelog entry for last PR
joshgoebel May 22, 2020
f30dbf7
add nnfx theme (#2571)
RocketMan May 27, 2020
87a338b
(themes) Add new lioshi theme (#2581)
lioshi May 29, 2020
debfdf7
Added Cisco Command Line to SUPPORTED_LANGUAGES.md (#2583)
BMatheas May 31, 2020
c4c9772
(themes) add `nnfx-dark` theme (#2584)
RocketMan Jun 1, 2020
1bfe834
enh(protobuf) Support multiline comments (#2597)
Paxa Jun 8, 2020
d8189c6
enh(java) added support for hexadecimal floating point literals (#2509)
0xflotus Jun 8, 2020
adb813c
(chore) Update issue templates (#2574)
joshgoebel Jun 8, 2020
1936dbd
enh(toml)(ini) Improve parsing of complex keys (#2595)
aduh95 Jun 10, 2020
a010c15
(chore) add `.js` extension to import statements (#2601)
aduh95 Jun 11, 2020
b4046ce
enh(dart) highlight built-in nullable types (#2598)
srawlins Jun 11, 2020
014343e
enh(csharp) highlight generics in more cases (#2599)
TupikovVladimir Jun 11, 2020
dfeb3a1
(chore) fix tiny style issues, add linting npm task
joshgoebel Jun 11, 2020
c6dec5e
(chore) bump dev dependencies
joshgoebel Jun 11, 2020
84f7fa3
(chore) upgrade some dev stuff to newer versions
joshgoebel Jun 11, 2020
b2d19b0
bump v10.1.0
joshgoebel Jun 11, 2020
74de6ea
(chore) bump copyright
joshgoebel Jun 11, 2020
b1bce6e
(chore) more import below metadata comment
joshgoebel Jun 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended",
"standard"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"parser": '@typescript-eslint/parser',
"plugins": [
"@typescript-eslint"
],
"rules": {
"array-callback-return": "error",
"block-scoped-var": "error",
// we like our semi-colons
"semi": ["error","always"],
// our codebase doesn't do this at all, so disabled for now
"space-before-function-paren": ["error","never"],
// for now ignore diff between types of quoting
"quotes": "off",
// this is the style we are already using
"operator-linebreak": ["error","before", { "overrides": { "?": "after", ":": "after", "+": "after" } }],
// sometimes we declare variables with extra spacing
"indent": ["error", 2, {"VariableDeclarator":2}],
// seems like a good idea not to use explicit undefined
"no-undefined": "error",
// ensure import specifier contains file extension
"import/extensions": ["error", "always"],

// TODO maybe
"camelcase": "off", // TODO: turn on later
"init-declarations": ["error","always"]
},
"overrides": [
{
"files": ["src/**/*.js"],
"rules": {
// make sure there is no Node.js specific API slipping into the source files
"import/no-nodejs-modules": "error",
"import/no-commonjs": "error",
}
},
{
"files": ["src/languages/*.js"],
"rules": {
"no-unused-expressions": "off",
// languages are all over the map and we don't want to
// do a mass edit so turn off the most egregious rule violations
"indent": "off",
"comma-dangle": "off",
"array-bracket-spacing": "off",
"object-curly-spacing": "off",
"key-spacing": "off",
"object-curly-newline": "off",
"object-property-newline": "off"
}
}
]
};
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/language-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Language request
about: I really wish Highlight.js could highlight ...
title: PLEASE read the below carefully.
labels: ''
assignees: ''

---

First let us say that we'd also love it if Highlight.js could highlight whichever language you're about to request support for! And there is a chance you can help make that happen! But first...

...PLEASE READ THE FOLLOWING...

Highlight.js does not have a fundamental plan for implementing new languages
- i.e., the core team doesn't usually develop new languages. The core team
instead focuses on parser development, bugs, and supporting the existing
languages. They also currently does not have time to review, merge and
maintain any additional languages (fixing bugs, dealing with issues, etc).

Instead, the project works by encouraging 3rd party language grammars from
contributors willing to help develop and maintain them. We're also happy to
host those 3rd party language grammars at the ``highlightjs`` GitHub
organization - no matter how obscure or weird. Or you're wlecome to host it
yourself - we're still happy to link to it.

This means that *there's no point in requesting a new language without also
providing a 3rd party implementation* (we'll simply close "Please support
language Xyz" issues with a link to this explanation). If you'd like to see
a particular language available but cannot implement it, the best way to
make it happen is to find another developer interested in doing so.

For more info on actually developing a language see our :doc:`language-guide`,
and for information on how to properly package your 3rd party language module
see :doc:`language-contribution`.

If you are interested in contributing a 3rd party language grammar you can start with:

- https://highlightjs.readthedocs.io/en/latest/language-contribution.html

---

You actually don't need to create this issue at all unless you have a specific question about the 3rd party language grammar creation process - which we'd be glad to answer.
4 changes: 3 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// whole codebase isn't ES8/9 yet, but our tests and some things are
{
"esversion": 9,
"node": true
"node": true,
// eslint warns us about semicolons
"-W033": false
}
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ script:
npm run test
else
npm run test-browser
# our browser build should also work fine as a Node.js CommonJS module
node test/builds/browser_build_as_commonjs.js
fi
sudo: false # Use container-based architecture
2 changes: 2 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,5 @@ Contributors:
- G8t Guy <g8tguy@g8tguy.com>
- Samia Ali <samiaab1990@gmail.com>
- Alexandre Grison <a.grison@gmail.com>
- Jim Mason <jmason@ibinx.com>
- lioshi <lioshi@lioshi.com>
92 changes: 92 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
## Version 10.1.0

New themes:

- *NNFX* and *NNFX-dark* by [Jim Mason][]
- *lioshi* by [lioshi][]

Parser Engine:

- (parser) Now escapes quotes in text content when escaping HTML (#2564) [Josh Goebel][]
- (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][]
- (parser) Adds SHEBANG utility mode [Josh Goebel][]
- (parser) Adds `registerAliases` method (#2540) [Taufik Nurrohman][]
- (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][]
- (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][]
- (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][]
- (enh) Added `END_SAME_AS_BEGIN` mode to replace `endSameAsBegin` parser attribute (#2261) [Josh Goebel][]
- (fix) `fixMarkup` would rarely destroy markup when `useBR` was enabled (#2532) [Josh Goebel][]

Deprecations:

- `htmlbars` grammar is now deprecated. Use `handlebars` instead. (#2344) [Nils Knappmeier][]
- when using `highlightBlock` `result.re` deprecated. Use `result.relevance` instead. (#2552) [Josh Goebel][]
- ditto for `result.second_best.re` => `result.second_best.relevance` (#2552)
- `lexemes` is now deprecated in favor of `keywords.$pattern` key (#2519) [Josh Goebel][]
- `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][]

Language Improvements:

- fix(groovy) strings are not allowed inside ternary clauses (#2217) [Josh Goebel][]
- fix(typescript) add `readonly` keyword (#2562) [Martin (Lhoerion)][]
- fix(javascript) fix regex inside parens after a non-regex (#2530) [Josh Goebel][]
- enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][]
- enh(javascript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][]
- [enh] Add `OPTIMIZE:` and `HACK:` to the labels highlighted inside comments [Josh Goebel][]
- enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][]
- enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][]
- enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][]
- enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538) [Hankun Lin][]
- enh(cpp) recognize `priority_queue` `pair` as cpp containers (#2541) [Hankun Lin][]
- fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][]
- fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][]
- fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
- fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
- fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][]
- fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][]
- enh(dart) Add `late` and `required` keywords, the `Never` built-in type, and nullable built-in types (#2550) [Sam Rawlins][]
- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]
- enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][]
- enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][]
- fix(toml) Improve key parsing (#2595) [Antoine du Hamel][]

[Josh Goebel]: https://github.com/yyyc514
[Peter Plantinga]: https://github.com/pplantinga
[David Benjamin]: https://github.com/davidben
[Vania Kucher]: https://github.com/qWici
[Hankun Lin]: https://github.com/Linhk1606
[Nick Randall]: https://github.com/nicked
[Sam Rawlins]: https://github.com/srawlins
[Sergey Prokhorov]: https://github.com/seriyps
[Nils Knappmeier]: https://github.com/nknapp
[Martin (Lhoerion)]: https://github.com/Lhoerion
[Jim Mason]: https://github.com/RocketMan
[lioshi]: https://github.com/lioshi
[Pavel Evstigneev]: https://github.com/Paxa
[Antoine du Hamel]: https://github.com/aduh95


## Version 10.0.2

Brower build:

- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][]
- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][]

Parser Engine Changes:

- [Issue](https://github.com/highlightjs/highlight.js/issues/2522) fix(parser) Fix freez issue with illegal 0 width matches (#2524) [Josh Goebel][]


[Josh Goebel]: https://github.com/yyyc514


## Version 10.0.1

Parser Engine Changes:

- (bug) Fix sublanguage with no relevance score (#2506) [Josh Goebel][]

[Josh Goebel]: https://github.com/yyyc514


## Version 10.0.0

New languages:
Expand Down
9 changes: 8 additions & 1 deletion SUPPORTED_LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| BNF | bnf | |
| Brainfuck | brainfuck, bf | |
| C# | csharp, cs | |
| C | h | |
| C | c, h | |
| C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | |
| C/AL | cal | |
| Cache Object Script | cos, cls | |
Expand All @@ -40,6 +40,8 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| CSP | csp | |
| CSS | css | |
| Cap’n Proto | capnproto, capnp | |
| Chaos | chaos, kaos | [highlightjs-chaos](https://github.com/chaos-lang/highlightjs-chaos) |
| Cisco CLI | cisco | [highlightjs-cisco-cli](https://github.com/BMatheas/highlightjs-cisco-cli) |
| Clojure | clojure, clj | |
| CoffeeScript | coffeescript, coffee, cson, iced | |
| CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) |
Expand Down Expand Up @@ -91,6 +93,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| JSON | json | |
| Java | java, jsp | |
| JavaScript | javascript, js, jsx | |
| Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) |
| Kotlin | kotlin, kt | |
| LaTeX | tex | |
| Leaf | leaf | |
Expand Down Expand Up @@ -120,6 +123,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| Nginx | nginx, nginxconf | |
| Nim | nimrod | |
| Nix | nix | |
| Object Constraint Language | ocl | [highlightjs-ocl](https://github.com/nhomble/highlightjs-ocl) |
| OCaml | ocaml, ml | |
| Objective C | objectivec, mm, objc, obj-c | |
| OpenGL Shading Language | glsl | |
Expand Down Expand Up @@ -172,6 +176,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| Stylus | stylus, styl | |
| SubUnit | subunit | |
| Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) |
| Svelte | svelte | [highlightjs-svelte](https://github.com/AlexxNB/highlightjs-svelte) |
| Swift | swift | |
| Tcl | tcl, tk | |
| Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) |
Expand All @@ -181,7 +186,9 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) |
| Twig | twig, craftcms | |
| TypeScript | typescript, ts | |
| Unicorn Rails log | unicorn-rails-log | [highlightjs-unicorn-rails-log](https://github.com/sweetppro/highlightjs-unicorn-rails-log)
| VB.Net | vbnet, vb | |
| VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) |
| VBScript | vbscript, vbs | |
| VHDL | vhdl | |
| Vala | vala | |
Expand Down
33 changes: 20 additions & 13 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Highlight.js exports a few functions as methods of the ``hljs`` object.


``highlight(languageName, code, ignore_illegals, continuation)``
---------------------------------------------------------
----------------------------------------------------------------

Core highlighting function.
Accepts a language name, or an alias, and a string with the code to highlight.
Expand All @@ -32,7 +32,7 @@ Returns an object with the following properties:


``highlightAuto(code, languageSubset)``
----------------------------------------
---------------------------------------

Highlighting with language detection.
Accepts a string with the code to highlight and an optional array of language names and aliases restricting detection to only those languages. The subset can also be set with ``configure``, but the local parameter overrides the option if set.
Expand Down Expand Up @@ -76,7 +76,7 @@ Configures global options:
* ``classPrefix``: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets.
* ``languages``: an array of language names and aliases restricting auto detection to only these languages.
* ``languageDetectRe``: a regex to configure how CSS class names map to language (allows class names like say `color-as-php` vs the default of `language-php`, etc.)
* ``noHighlightRe``: a regex to configure which CSS classes are to be skipped completely
* ``noHighlightRe``: a regex to configure which CSS classes are to be skipped completely.

Accepts an object representing options with the values to updated. Other options don't change
::
Expand All @@ -85,15 +85,14 @@ Accepts an object representing options with the values to updated. Other options
tabReplace: ' ', // 4 spaces
classPrefix: '' // don't append class prefix
// … other options aren't changed
})
});
hljs.initHighlighting();


``initHighlighting()``
----------------------

Applies highlighting to all ``<pre><code>..</code></pre>`` blocks on a page.

Applies highlighting to all ``<pre><code>...</code></pre>`` blocks on a page.


``initHighlightingOnLoad()``
Expand All @@ -102,24 +101,32 @@ Applies highlighting to all ``<pre><code>..</code></pre>`` blocks on a page.
Attaches highlighting to the page load event.


``registerLanguage(name, language)``
``registerLanguage(languageName, languageDefinition)``
------------------------------------

Adds new language to the library under the specified name. Used mostly internally.

* ``name``: a string with the name of the language being registered
* ``language``: a function that returns an object which represents the
* ``languageName``: a string with the name of the language being registered
* ``languageDefinition``: a function that returns an object which represents the
language definition. The function is passed the ``hljs`` object to be able
to use common regular expressions defined within it.


``registerAliases(alias|aliases, {languageName})``
--------------------------------------------------

Adds new language alias or aliases to the library for the specified language name defined under ``languageName`` key.

* ``alias|aliases``: a string or array with the name of alias being registered
* ``languageName``: the language name as specified by ``registerLanguage``.


``listLanguages()``
----------------------------
-------------------

Returns the languages names list.



.. _getLanguage:


Expand All @@ -132,7 +139,7 @@ Returns the language object if found, ``undefined`` otherwise.


``requireLanguage(name)``
---------------------
-------------------------

Looks up a language by name or alias.

Expand All @@ -150,5 +157,5 @@ Enables *debug/development* mode. **This mode purposely makes Highlight.js more

For example, if a new version suddenly had a serious bug (or breaking change) that affected only a single language:

* **In Safe Mode**: All other languages would continue to highlight just fine. The broken language would appear as a code block, but without any highlighting (as if it were plaintext).
* **In Safe Mode**: All other languages would continue to highlight just fine. The broken language would appear as a code block, but without any highlighting (as if it were plaintext).
* **In Debug Mode**: All highlighting would stop when an error was encountered and a JavaScript error would be thrown.
Loading