- Upgrade to Angular 19.
- refactor: Use
afterRenderEffect
instead ofeffect
in the highlight directives.
- Upgrade to Angular 18, closes #286.
- fix:
highlight.js
dependency was removed in v11, closes #283.
- Update to Angular 17.
- feat: Add
provideHighlightOptions
function to easily override the default options. - feat: Add
provideGistOptions
function in the plus package to easily set gist id and secret into the HTTP requests. - feat: Add
startFrom
andsingleLine
inputs tolineNumbers
directive, closes #274. - feat: Make
codeFromUrl
pipe supports loading of relative URLs, closes #224. - feat: Add
highlight
directive which uses a different function and provide different options, closes #275. - feat: Add
lineNumbersOptions
property to set the default line number options. - refactor: Rename the previous
highlight
directive tohighlightAuto
. - refactor: split line numbers functionality into its own directive.
- refactor: Use
highlight.js
original interfaces. - enhance: Allow loading theme from global options if
highlight.js
was imported externally.
- The
highlight
directive now uses a different function from highlight.js which requires selecting a language. - The
highlightAuto
directive automatically detects the language and highlights the code.
- feat: Migrate to Angular standalone components, closes #260 in cadcd11.
- fix: Add line-numbers as a sub package, closes #234 in 7f8f551.
- refactor: Update deprecated rxjs usage.
- When using
HighlightPlusModule
, you must haveprovideHttpClient()
provided in yourmain.ts
file in order to make the http requests work. - The line numbers plugin is now included within the package, the import path should point to the new sub-package
ngx-highlightjs/line-numbers
providers: [
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
lineNumbersLoader: () => import('ngx-highlightjs/line-numbers')
}
}
]
- Update to Angular 16.
- Update to Angular 15.
- Fix
setTheme
does not load theme ifthemePath
was not specified in the configuration, closes #247 in 4a74d84. - Fix Angular Universal error, closes 243 in 8815a9e.
- Make Angular Universal happy with
setTheme
functionHighlightLoader
service, in 0ed6508. - Make gist setter public, closes #242 in 3208b0d.
- Add support for trusted types (CSP), in 125a55b.
- Update to Angular 14 in c13d41c.
- fix typo: Angular async pipe return type is 'string|null' not 'string' as [highlight] expect, closes #209 in 277322f.
- fix: check if
options
is defined inHighlightLoader
service, closes #219 in cac55cb. - fix: Update deprecated usage of
throwError
in rxjs 7.
- fix: RxJS peerDependency warning when installing the package, closes#205 in 87c8521.
- fix: Passing empty string to
[highlight]
input should clear the highlighted content (test cases is added for that), closes #119 in 2d67fb3.
- feat: Load highlighting theme dynamically, ability to switch between themes easily, closes #194 in 9422d29.
- Upgrade library to Angular 13
- Upgrade usage to highlight.js v11, you can find the breaking changes from the official page here.
- Build the library with partial compilationMode.
- feat: Add the missing functions from v11 in
HighlightJS
service. - Remove deprecated function in v11, such as
initHighlighting()
,highlightBlock()
,fixMarkup()
fromHighlightJS
service.
- refactor:
(highlighted)
output has been updated to highlight.js v11, the result object has a new interfaceHighlightAutoResult
. - refactor:
HighlightJS.configure(config)
has been updated the config interface to highlight.js v11.
- Upgrade to Angular 12
- Set peer dependency of highlight.js to v10
The library is still compatible with the new version of highlight.js v11 but the highlighting function will be deprecated in their next release
- 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