Skip to content

Commit

Permalink
Merge pull request #104 from MurhafSousli/dev
Browse files Browse the repository at this point in the history
v4.0.1
  • Loading branch information
MurhafSousli authored Jan 1, 2020
2 parents 9992dc0 + 859af86 commit 036504b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.0.1

- fix: Change `r` property name to `relevance` in `HighlightResult` interface, closes [#84](https://github.com/MurhafSousli/ngx-highlightjs/issues/84) in [ce53661](https://github.com/MurhafSousli/ngx-highlightjs/commit/ce536614179a97dbd26a35bd40dd5226f8d6a408).
- fix: Sanitize highlighted code before appending it to the DOM, closes [#101](https://github.com/MurhafSousli/ngx-highlightjs/issues/101) in [9afe6b6](https://github.com/MurhafSousli/ngx-highlightjs/pull/103/commits/9afe6b661255c4e8d6569dec3370843eb34d16de).
- fix: Check if `nativeElement.firstChildElement` is not null before calling line numbers lib, in [494c976](https://github.com/MurhafSousli/ngx-highlightjs/pull/104/commits/494c97616fc6e1b9e965e3910a51214d86837a39).

## 4.0.0

- feat: Lazy-load **hljs** library, closes [#89](https://github.com/MurhafSousli/ngx-highlightjs/issues/89) in [8cdba13](https://github.com/MurhafSousli/ngx-highlightjs/pull/88/commits/8cdba13d72e563a2189b816d41f959e3dc18be21).
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-highlightjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-highlightjs",
"version": "4.0.0",
"version": "4.0.1",
"description": "Instant code highlighting, auto-detect language, super easy to use.",
"homepage": "http://github.com/murhafsousli/ngx-highlightjs",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-highlightjs/src/lib/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Highlight implements OnChanges {
// If lines count is 1, the line numbers library will not add numbers
// Observe changes to add 'hljs-line-numbers' class only when line numbers is added to the code element
this._lineNumbersObs = new MutationObserver(() => {
if (this._nativeElement.firstElementChild.tagName.toUpperCase() === 'TABLE') {
if (this._nativeElement.firstElementChild && this._nativeElement.firstElementChild.tagName.toUpperCase() === 'TABLE') {
this._nativeElement.classList.add('hljs-line-numbers');
}
this.destroyLineNumbersObserver();
Expand Down

0 comments on commit 036504b

Please sign in to comment.