Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions VERSION_11_UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Overview of Breaking Changes

Welcome to version 11.0. This a major release and therefore contains breaking changes. Below is a complete list of those such changes.
Welcome to version 11.0. This a major release and therefore contains breaking changes. Below is a complete list of those such changes.


### Built-in set of "Common" Languages
Expand Down Expand Up @@ -60,17 +60,17 @@ hljs.registerAliases(["php3","php4","php5","php6","php7","php8"],{ languageName:
### Styles and CSS

- 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.
- `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.
- `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.
- `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).
- `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).
- 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.
- 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.
- 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.
- 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.


#### Grammar Scopes

- `.meta-string` removed/deprecated. Use `.meta .string` (a nested scope) instead. See [meta-keyword][].
- `.meta-keyword` removed/deprecated. Use `.meta .keyword` (a nested scope) instead. See [meta-keyword][].
- `.meta-string` removed/deprecated. Use `.meta .string` (a nested scope) instead. See [meta-keyword][].
- `.meta-keyword` removed/deprecated. Use `.meta .keyword` (a nested scope) instead. See [meta-keyword][].

### Behavioral changes

Expand Down Expand Up @@ -120,11 +120,11 @@ Note: The object literal passed to the `before:highlightElement` callback now pa
- The `relevance` key returned by `highlight()` is no longer guaranteed to be an even integer.
- `highlightElement` now always tags blocks with a consistent `language-[name]` class

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.
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.

#### Feature Removal

- 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).
- 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).

An example:

Expand All @@ -135,11 +135,11 @@ var a = 4;
</code></pre>
```

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.
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.

- `fixMarkup` has been removed.

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)
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)

- `CSS_NUMBER_MODE` has been removed.

Expand Down
10 changes: 0 additions & 10 deletions src/styles/base16/3024.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ base0E #a16a94 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #cdab53 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #a5a2a2;
background: #090300;
Expand Down
10 changes: 0 additions & 10 deletions src/styles/base16/apathy.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ base0E #4C963E Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #3E965B Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #81B5AC;
background: #031A16;
Expand Down
10 changes: 0 additions & 10 deletions src/styles/base16/apprentice.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ base0E #87AFD7 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #5F87AF Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #BCBCBC;
background: #262626;
Expand Down
10 changes: 0 additions & 10 deletions src/styles/base16/ashes.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ base0E #C795AE Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #C79595 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #C7CCD1;
background: #1C2023;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-cave-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #955ae7 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #bf40bf Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #585260;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-cave.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #955ae7 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #bf40bf Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #8b8792;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-dune-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #b854d4 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #d43552 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #6e6b5e;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-dune.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #b854d4 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #d43552 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #a6a28c;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-estuary-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #5f9182 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #9d6c7c Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #5f5e4e;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-estuary.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #5f9182 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #9d6c7c Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #929181;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-forest-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #6666ea Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #c33ff3 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #68615e;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/atelier-forest.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #6666ea Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #c33ff3 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #a8a19f;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/cupertino.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #a90d91 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #826b28 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #404040;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/danqing.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #CCA4E3 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #CA6924 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #e0f0eF;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/darcula.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #cc7832 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #808080 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #a9b7c6;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/dark-violet.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #7e5ce6 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #a886bf Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #b08ae6;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/darkmoss.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #9bc0c8 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #d27b53 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #c7c7a5;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/darktooth.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #8F4673 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #A87322 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #A89984;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/decaf.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #efb3f7 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #ff93b3 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #cccccc;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/default-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #ba8baf Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #a16946 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #d8d8d8;
Expand Down
9 changes: 0 additions & 9 deletions src/styles/base16/default-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ base0E #ba8baf Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #a16946 Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/

pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}

code.hljs {
padding: 3px 5px;
}

.hljs {
color: #383838;
Expand Down
Loading