MCPcopy Index your code
hub / github.com/Hashnode/starter-kit / E

Function E

packages/utils/renderer/highlight.js:802–850  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

800 : e;
801 }
802 function E(e) {
803 let n = null;
804 const t = (function (e) {
805 var n = e.className + ' ';
806 n += e.parentNode ? e.parentNode.className : '';
807 const t = f.languageDetectRe.exec(n);
808 if (t) {
809 var r = y(t[1]);
810 return (
811 r ||
812 (console.warn(d.replace('{}', t[1])),
813 console.warn('Falling back to no-highlight mode for this block.', e)),
814 r ? t[1] : 'no-highlight'
815 );
816 }
817 return n.split(/\s+/).find((e) => p(e) || y(e));
818 })(e);
819 if (p(t)) return;
820 S('before:highlightBlock', { block: e, language: t }),
821 f.useBR
822 ? ((n = document.createElement('div')).innerHTML = e.innerHTML
823 .replace(/\n/g, '')
824 .replace(/<br[ /]*>/g, '\n'))
825 : (n = e);
826 const r = n.textContent,
827 a = t ? m(t, r, !0) : v(r),
828 i = M(n);
829 if (i.length) {
830 const e = document.createElement('div');
831 (e.innerHTML = a.value), (a.value = L(i, M(e), r));
832 }
833 (a.value = x(a.value)),
834 S('after:highlightBlock', { block: e, result: a }),
835 (e.innerHTML = a.value),
836 (e.className = (function (e, n, t) {
837 var r = n ? s[n] : t,
838 a = [e.trim()];
839 return (
840 e.match(/\bhljs\b/) || a.push('hljs'), e.includes(r) || a.push(r), a.join(' ').trim()
841 );
842 })(e.className, t, a.language)),
843 (e.result = { language: a.language, re: a.relevance, relavance: a.relevance }),
844 a.second_best &&
845 (e.second_best = {
846 language: a.second_best.language,
847 re: a.second_best.relevance,
848 relavance: a.second_best.relevance,
849 });
850 }
851 const w = () => {
852 if (!w.called) {
853 w.called = !0;

Callers 2

highlight.jsFile · 0.70
xFunction · 0.70

Calls 8

yFunction · 0.70
pFunction · 0.70
SFunction · 0.70
mFunction · 0.70
vFunction · 0.70
xFunction · 0.70
MFunction · 0.50
execMethod · 0.45

Tested by

no test coverage detected