We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fc6690 commit 81147b3Copy full SHA for 81147b3
src/app/public/ngx-gist-line-numbers.service.ts
@@ -9,7 +9,11 @@ export class NgxGistLineNumbersService {
9
private isLoaded = false;
10
11
public async load(): Promise<void> {
12
- if (this.isLoaded) {
+ if (
13
+ this.isLoaded ||
14
+ typeof this.document.defaultView?.hljs?.initLineNumbersOnLoad ===
15
+ 'function'
16
+ ) {
17
return;
18
}
19
@@ -24,7 +28,7 @@ export class NgxGistLineNumbersService {
24
28
);
25
29
26
30
27
- firstValueFrom(this.loadHljsLineNumbersLibrary()).then(() => {
31
+ await firstValueFrom(this.loadHljsLineNumbersLibrary()).then(() => {
32
// The library `highlightjs-line-numbers.js` adds new functions to the
33
// `highlight.js` scope on load, so we should now be able to call it
34
// without failure.
0 commit comments