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

Function x

packages/utils/renderer/highlight.js:440–516  ·  view source on GitHub ↗
(t, r)

Source from the content-addressed store, hash-verified

438 }
439 var m = {};
440 function x(t, r) {
441 var i = r && r[0];
442 if (((L += t), null == i)) return u(), 0;
443 if ('begin' === m.type && 'end' === r.type && m.index === r.index && '' === i) {
444 if (((L += o.slice(r.index, r.index + 1)), !l)) {
445 const n = Error('0 width match regex');
446 throw ((n.languageName = e), (n.badRule = m.rule), n);
447 }
448 return 1;
449 }
450 if (((m = r), 'begin' === r.type))
451 return (function (e) {
452 var t = e[0],
453 r = e.rule;
454 const a = new n(r),
455 i = [r.__beforeBegin, r['on:begin']];
456 for (const n of i) if (n && (n(e, a), a.ignore)) return p(t);
457 return (
458 r &&
459 r.endSameAsBegin &&
460 (r.endRe = RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm')),
461 r.skip
462 ? (L += t)
463 : (r.excludeBegin && (L += t), u(), r.returnBegin || r.excludeBegin || (L = t)),
464 h(r),
465 r.returnBegin ? 0 : t.length
466 );
467 })(r);
468 if ('illegal' === r.type && !a) {
469 const e = Error(
470 'Illegal lexeme "' + i + '" for mode "' + (R.className || '<unnamed>') + '"',
471 );
472 throw ((e.mode = R), e);
473 }
474 if ('end' === r.type) {
475 var s = (function (e) {
476 var t = e[0],
477 r = o.substr(e.index),
478 a = (function e(t, r, a) {
479 let i = (function (e, n) {
480 var t = e && e.exec(n);
481 return t && 0 === t.index;
482 })(t.endRe, a);
483 if (i) {
484 if (t['on:end']) {
485 const e = new n(t);
486 t['on:end'](r, e), e.ignore && (i = !1);
487 }
488 if (i) {
489 for (; t.endsParent && t.parent; ) t = t.parent;
490 return t;
491 }
492 }
493 if (t.endsWithParent) return e(t.parent, r, a);
494 })(R, e, r);
495 if (!a) return T;
496 var i = R;
497 i.skip

Callers 3

bFunction · 0.70
EFunction · 0.70
highlight.jsFile · 0.70

Calls 8

uFunction · 0.70
nFunction · 0.70
pFunction · 0.70
hFunction · 0.70
eFunction · 0.70
EFunction · 0.70
execMethod · 0.45
closeNodeMethod · 0.45

Tested by

no test coverage detected