You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,22 @@
1
1
# Changelog
2
2
3
+
## 5.0.0
4
+
5
+
- Upgrade usage to highlight.js v11, you can find the breaking changes from the official page [here](https://highlightjs.readthedocs.io/en/latest/upgrade-11.html).
6
+
- feat: Add the missing functions from v11 in `HighlightJS` service.
7
+
- Remove deprecated function in v11, such as `initHighlighting()`, `highlightBlock()`, `fixMarkup()` from `HighlightJS` service.
8
+
9
+
### Breaking changes
10
+
11
+
- refactor: `(highlighted)` output has been updated to highlight.js v11, the result object has a new interface `HighlightAutoResult`.
12
+
- refactor: `HighlightJS.configure(config)` has been updated the config interface to highlight.js v11.
13
+
3
14
## 4.1.4
4
15
5
16
- Upgrade to Angular 12
6
-
- Set peer dependency of hljs to v10
17
+
- Set peer dependency of highlight.js to v10
18
+
19
+
> The library is still compatible with the new version of highlight.js v11 but the highlighting function will be deprecated in their next release
Copy file name to clipboardExpand all lines: projects/ngx-highlightjs/src/lib/highlight.model.ts
+62-33Lines changed: 62 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,42 @@
1
1
import{InjectionToken}from'@angular/core';
2
2
3
+
/**
4
+
* Full documentation is available here https://highlightjs.readthedocs.io/en/latest/api.html
5
+
*/
6
+
3
7
exportinterfaceHighlightLibrary{
4
8
5
9
/**
6
-
* Core highlighting function.
7
-
* @param name Accepts a language name, or an alias
8
-
* @param value A string with the code to highlight.
9
-
* @param ignore_illegals When present and evaluates to a true value, forces highlighting to finish
10
-
* even in case of detecting illegal syntax for the language instead of throwing an exception.
11
-
* @param continuation An optional mode stack representing unfinished parsing.
12
-
* When present, the function will restart parsing from this state instead of initializing a new one
10
+
* Core highlighting function. Accepts the code to highlight (string) and a list of options (object)
11
+
* @param code Accepts the code to highlight
12
+
* @param language must be present and specify the language name or alias of the grammar to be used for highlighting
13
+
* @param ignoreIllegals (optional) when set to true it forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception.
/** tabReplace: a string used to replace TAB characters in indentation. */
80
-
tabReplace?: string;
81
-
/** useBR: a flag to generate <br> tags instead of new-line characters in the output, useful when code is marked up using a non-<pre> container. */
82
-
useBR?: boolean;
83
98
/** classPrefix: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets. */
84
99
classPrefix?: string;
85
100
/** languages: an array of language names and aliases restricting auto detection to only these languages. */
86
101
languages?: string[];
102
+
/** 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.) */
103
+
languageDetectRe: string;
104
+
/** noHighlightRe: a regex to configure which CSS classes are to be skipped completely. */
105
+
noHighlightRe: string;
106
+
/** a CSS selector to configure which elements are affected by hljs.highlightAll. Defaults to 'pre code'. */
0 commit comments