MurhafSousli / ngx-highlightjs

Angular syntax highlighting module

Home Page:https://ngx-highlight.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minor documentation issue

trazek opened this issue · comments

Reproduction

import { HighlightModule, HIGHLIGHT_OPTIONS } from 'ngx-highlightjs';
 
@NgModule({
  imports: [
    HighlightModule
  ],
  providers: [
    {
      provide: HIGHLIGHT_OPTIONS,
      useValue: {
        coreLibraryLoader: () => import('highlight.js/lib/core'),
        lineNumbersLoader: () => import('highlightjs-line-numbers.js'), // Optional, only if you want the line numbers
        languages: {
          typescript: () => import('highlight.js/lib/languages/typescript'),
          css: () => import('highlight.js/lib/languages/css'),
          xml: () => import('highlight.js/lib/languages/xml')
        }
      }
    }
  ],
})
export class AppModule { }

It appears coreLibraryLoader: () => import('highlight.js/lib/core') does not exist in node_modules when downloaded. We had to reference coreLibraryLoader: () => import('highlight.js/lib/highlight')

This depends on the hljs library's version, before it was highlight.js/lib/highlight. after their last version I had to import it from highlight.js/lib/core.