- Upgrade to Angular 11
- Build the library in strict mode
- refactor: Highlight directive => function
highlightElement(code: string, languages: string[])
: the languages param is not optional anymore.
- Upgrade project to Angular 10.
- fix: Remove the default behavior of adding highlight.js to the bundle directory, closes #122 in 339ff18.
- fix: Setting the highlighted code to empty string will not reflect the value change, closes #199 in 9ee1942.
- Upgrade to Angular 9 in #113.
- fix: Remove warning when the package is installed in Angular 9 in 6d491be.
- fix: Change
r
property name torelevance
inHighlightResult
interface, closes #84 in ce53661. - fix: Sanitize highlighted code before appending it to the DOM, closes #101 in 9afe6b6.
- fix: Check if
nativeElement.firstChildElement
is not null before calling line numbers lib, in 494c976.
- feat: Lazy-load hljs library, closes #89 in 8cdba13.
- feat: Lazy-load languages scripts, in 952f33c.
- feat: Gist directive, closes #90 in 8b4c8fc.
- feat: Highlight code directly from URL, closes #91 in 5fa3c59.
- feat: Line numbers, closes #35 in c19b878.
- enhance: Move
highlight.js
package from peerDependencies to dependencies - fix: Check if [highlight] input got undefined value, closes #81 in f2b14bd.
- fix: Add test files, closes #79 in 2913d05.
- Since the core library
highlight.js
will be lazy-loaded, all hljs functions inHighlightJS
will return observables to make sure the library is loaded before execution. HighlightChildren
directive has been deprecated.- The global options languages property
NgScrollOptions.languages
type has changed. HighlightModule.forRoot()
is deprecated, the highlight global options can be set using the injection tokenHIGHLIGHT_OPTIONS
- fix(HighlightChildren): fix
OnDestroy()
error (Cannot read property 'disconnect' of undefined), closes #75 in 3379905.
Version 3 is written from scratch, Please read the updated documentations.
- fix(HighlightJS): load hljs theme only if hljs script is loaded automatically, closes #56 in 66d0688.
- fix(HighlightJS): Fix initializing hljs configure and the function parameter interface
hljs.configure(config: HighlightConfig)
. - refactor(HighlightJS): Inject
DOCUMENT
to access the document class, in 4ff6ceb. - enhance(HighlightJS): Access hljs from
document.defaultView
. - Add rxjs as peerDependency.
- fix peerDependencies for Angular >= 6
- refactor(HighlightJS): Provide
HighlightJS
usingprovidedIn: 'root'
- refactor(HighlightJS): Add types on parameters in hljs functions, fixed in #40
- Fix(HighlightDirective):
highlight="all"
, Apply.hljs
class on code elements only, closes #23
- Feature(language input): an array of language names and aliases restricting auto detection to only these languages, closes #20.
- Feature(hljs global config): set global config in
HighlightModule.forRoot({ config: hljsConfig })
). - Support the manual load of hljs script and styles.
- Feature: Add
(highlighted)
output, a stream that emits higlight result, closes #16.
- Refactor with RxJS pipe 5.5 style
- Fix(HighlightService) Move
InjectionToken
to a seperate file, closes #11
- No Changes, just an update for the build enviroment
- fix(HighlightDirective): Use
el.tagName.toLowerCase()
to check for if the highlight element is type of<code>
- Remove HighlightUmdModule and systemjs support
- Refactir(HighlightModule)
- Add
[code]
input
-
Improve performance
-
Fix load hljs script only once
-
Remove
hlAuto
andhlDelay
inputs from HighlightDirective, but they are still usable in HighlightUmdDirective -
Update
HighlightModule
parameter:before:
HighlightModule.forRoot('monokai-sublime', 'assets/js/highlight-js');
after
HighlightModule.forRoot({ theme: 'monokai-sublime', path: 'assets/js/highlight-js', auto: true });
- feat(HighlightModule): Choose highlight theme and set library path
- feat(Auto-load script)
- feat(Auto-load theme)
- Initial release