All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.app.shared.highlight.highlight.service.ts Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
import { Injectable } from '@angular/core';

import hljs from 'highlight.js';

@Injectable({
  providedIn: 'root'
})
export class HighLightJService {

  constructor() {
  }

  highlightElement(baseElement: Element, codeSelectorAll: string = 'pre code') {
      const codes = baseElement.querySelectorAll(codeSelectorAll);
      codes.forEach(code => hljs.highlightBlock(code));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy