MCPcopy Create free account
hub / github.com/Hashnode/starter-kit / highlighted

Function highlighted

packages/utils/renderer/highlight.js:330–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

328 return this.unknownLanguage ? '' : 'hljs ' + this.detectedLanguage;
329 },
330 highlighted() {
331 if (!this.autoDetect && !hljs.getLanguage(this.language))
332 return (
333 console.warn(`The language "${this.language}" you specified could not be found.`),
334 (this.unknownLanguage = !0),
335 t(this.code)
336 );
337 let e;
338 return (
339 this.autoDetect
340 ? ((e = hljs.highlightAuto(this.code)), (this.detectedLanguage = e.language))
341 : ((e = hljs.highlight(this.language, this.code, this.ignoreIllegals)),
342 (this.detectectLanguage = this.language)),
343 e.value
344 );
345 },
346 autoDetect() {
347 return !(this.language && ((e = this.autodetect), !e && '' !== e));
348 var e;

Callers

nothing calls this directly

Calls 1

tFunction · 0.70

Tested by

no test coverage detected