src.app.shared.highlight.highlight.service.ts Maven / Gradle / Ivy
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