ngx-admin/docs/app/@theme/services/highlight.service.ts
Sergey Andrievskiy 2129689f98 feat: docs app
2020-08-28 19:29:11 +03:00

10 lines
258 B
TypeScript

import { Injectable } from '@angular/core';
import * as hljs from 'highlight.js';
@Injectable()
export class NgxHighlightService {
public highlight(code: string): string {
return hljs.highlightAuto(code, ['ts', 'html', 'scss', 'nginx']).value;
}
}