MurhafSousli / ngx-highlightjs

Angular syntax highlighting module

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long string is not highlighted (JS)

ihor-zinchenko opened this issue · comments

commented

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/ngx-highlightjs-cteq4i?file=src%2Fapp%2Fhome%2Fhome.component.ts

Environment

  • Angular: latest
  • Browser(s): Chrome latest
  • Operating System Windows latest

It seems that hljs was detecting the wrong language, you can force it to select from specific languages using the languages input

<code [highlight]="code" [languages]="['ts']"></code>

Here is a fixed stackblitz
https://stackblitz.com/edit/ngx-highlightjs-8abqqm?file=src%2Fapp%2Fhome%2Fhome.component.html